@tailwind base;
@tailwind components;
@tailwind utilities;

@layer components {
    .btn-primary {
        @apply bg-red-700 text-amber-50 font-bold py-3 px-6 rounded-lg uppercase tracking-wider shadow-md transform transition-all duration-300;
        @apply hover:bg-red-800 hover:shadow-lg hover:-translate-y-0.5;
        @apply focus:outline-none focus:ring-4 focus:ring-red-700 focus:ring-opacity-50;
        font-family: 'Gilroy', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
        border: 20px solid rgba(0,0,0,0.05);
        letter-spacing: 0.06em;
        @apply sm:py-2 sm:px-4 md:py-3 md:px-6;
    }

    .btn-lg {
        @apply py-4 px-8 text-lg;
    }

    .btn-secondary {
        @apply bg-gray-200 text-gray-800 font-bold py-3 px-6 rounded-lg uppercase tracking-wider transition-colors duration-300;
        @apply hover:bg-gray-300;
        @apply focus:outline-none focus:ring-4 focus:ring-gray-400 focus:ring-opacity-50;
        font-family: 'Gilroy', system-ui, sans-serif;
        border: 2px dashed rgba(0,0,0,0.08);
    }

    .btn-primary-dark {
        @apply bg-amber-50 text-red-700 font-bold py-2 px-5 rounded-lg uppercase tracking-wider shadow-sm transform transition-all duration-300;
        @apply hover:bg-amber-100 hover:shadow-md hover:-translate-y-0.5;
        @apply focus:outline-none focus:ring-4 focus:ring-amber-50 focus:ring-opacity-50;
        font-family: 'Gilroy', system-ui, sans-serif;
    }

    :root {
        --btn-white: #ffffff;
        --btn-dark-gray: #222222;
        --btn-cta-start: #2563eb;
        --btn-cta-end: #60a5fa;
        --btn-cta-text: #ffffff;
    }

    .btn {
        padding: 0.2rem 1.5rem;
        border-radius: 40px;
        font-weight: 600;
        text-decoration: none;
        transition: all 0.3s;
        display: inline-block;
        text-align: center;
        border: none;
        cursor: pointer;
        font-family: 'Gilroy', 'Open Sans', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
        white-space: nowrap;
        line-height: 1;
        vertical-align: middle;
    }

    .btn-login {
        /* Basis: transparente, pillförmige Fläche mit feiner Linie */
        background-color: transparent;
        color: var(--btn-white);
        border: 2px solid rgba(255,255,255,0.12); /* dezentere Linie statt riesigem Border */
        /* erhöhtes Padding für luftige Optik */
        padding: 0.65rem 1.35rem;
        font-size: 0.95rem;
        min-width: 7.25rem; /* sorgt für konsistente Breite */
        box-shadow: 0 2px 0 rgba(0,0,0,0.06);
        border-radius: 9999px; /* fully rounded */
        display: inline-flex;
        align-items: center;
        gap: 0.75rem; /* etwas mehr Abstand zu Icon/Text */
        justify-content: center;
        font-weight: 700;
        letter-spacing: 0.02em;
        transition: transform 180ms cubic-bezier(.2,.9,.3,1), box-shadow 180ms cubic-bezier(.2,.9,.3,1), background-color 180ms ease, color 180ms ease;
        line-height: 1; /* verhindert vertikales Zusammenziehen */
    }

    /* Invertiert: sichtbarer, warmer Call-to-Action */
    .btn-login.inverted {
        /* Verwende CSS-Variablen für einfachen Theme-Wechsel */
        background: linear-gradient(180deg, var(--btn-cta-start) 0%, var(--btn-cta-end) 100%);
        color: var(--btn-cta-text); /* dunkler Text für Kontrast */
        border-color: rgba(0,0,0,0.06);
        box-shadow: 0 8px 18px rgba(0,0,0,0.10); /* weicherer, größerer Schatten */
        transform: translateY(0);
        padding: 0.6rem 1.5rem; /* etwas breiter für CTA */
        font-size: 1rem;
    }

    .btn-login.inverted:hover {
        filter: none;
        transform: translateY(-4px) scale(1.01);
        box-shadow: 0 14px 30px rgba(0,0,0,0.14);
    }

    .btn-login.filled {
        background-color: #ffd54f;
        color: #1f1f1f;
        border: none;
        box-shadow: 0 8px 18px rgba(0,0,0,0.10);
        padding: 0.6rem 1.4rem;
        font-size: 1rem;
    }

    .btn-login:hover {
        background-color: rgba(255,255,255,0.06);
        color: var(--btn-white);
        transform: translateY(-3px);
        box-shadow: 0 8px 18px rgba(0,0,0,0.08);
    }

    /* Accessibility: stronger focus outline */
    .btn-login:focus {
        outline: none;
        box-shadow: 0 0 0 6px rgba(255,213,79,0.15);
    }

    /* Small helper class for dashboard-specific buttons (Logout) */
    .btn-dashboard {
        background: linear-gradient(180deg,#fff7ed 0%,#ffe08a 100%);
        color: #6d6d6d;
        border: 1px solid rgba(0,0,0,0.06);
        padding: 0.5rem 0.9rem;
        border-radius: 12px;
        font-weight: 700;
        box-shadow: 0 6px 0 rgba(0,0,0,0.06);
        transition: transform 160ms ease, box-shadow 160ms ease;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
    }

    .btn-dashboard:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 18px rgba(0,0,0,0.08);
    }

    .vintage-mission {
        background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23924444' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    }

    .mission-stamp {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .stamp-icon {
        border: 4px solid #b91c1c; /* red-700 */
        padding: 1rem;
        color: #b91c1c; /* red-700 */
        background-color: #fef3c7; /* amber-100 */
        border-radius: 0.25rem;
        transform: rotate(-2deg);
    }

    .mission-stamp h3 {
        color: #1f2937; /* gray-800 */
        text-shadow: 1px 1px 0 #fef3c7; /* amber-100 */
    }


    @media (max-width: 420px) {
        .btn { padding: 0.5rem 1rem; border-radius: 20px; }
        .btn-login { padding: 0.45rem 1rem; }
    }

    @media (min-width: 768px) {
        #login-btn-desktop.btn-login,
        button#login-btn-desktop {
            min-width: 10.5rem; /* großzügigere Breite */
            padding: 0.75rem 1.6rem; /* mehr Luft */
            font-size: 1.02rem;
            border-radius: 9999px;
            box-shadow: 0 12px 28px rgba(37,99,235,0.12); /* sanfter CTA-Schatten */
            align-items: center;
            display: inline-flex;
            gap: 0.6rem;
            justify-content: center;
            letter-spacing: 0.01em;
            text-transform: none; /* keine Uppercase zwingend */
        }

        /* optionales Icon als Pseudo-Element (schlankes SVG) */
        #login-btn-desktop.btn-login::before,
        button#login-btn-desktop::before {
            content: '';
            display: inline-block;
            width: 18px;
            height: 18px;
            background-size: contain;
            background-repeat: no-repeat;
            background-position: center;
            /* kleines generisches Login-Icon (Pfeil nach rechts) als inline SVG */
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h14'/><path d='M12 5l7 7-7 7'/></svg>");
            transform: translateY(0);
        }

        /* Hover/Active für Desktop-Login */
        #login-btn-desktop.btn-login:hover,
        button#login-btn-desktop:hover {
            transform: translateY(-4px) scale(1.01);
            box-shadow: 0 18px 36px rgba(37,99,235,0.14);
        }

        #login-btn-desktop.btn-login:active,
        button#login-btn-desktop:active {
            transform: translateY(-1px);
            box-shadow: 0 8px 18px rgba(37,99,235,0.10);
        }
    }

    /* Mobile specific adjustments (makes the mobile button more tappable) */
    @media (max-width: 767px) {
        #login-btn-mobile.btn-login,
        button#login-btn-mobile {
            padding: 0.85rem 1rem;
            font-size: 1rem;
            border-radius: 14px;
            display: inline-flex;
            align-items: center;
            gap: 0.6rem;
        }

        #login-btn-mobile.btn-login::before,
        button#login-btn-mobile::before {
            content: '';
            display: inline-block;
            width: 16px;
            height: 16px;
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h14'/><path d='M12 5l7 7-7 7'/></svg>");
            background-size: contain;
            background-repeat: no-repeat;
            background-position: center;
        }
    }

    #login-btn-desktop:focus,
    button#login-btn-desktop:focus,
    #login-btn-mobile:focus,
    button#login-btn-mobile:focus {
        outline: none;
        box-shadow: 0 0 0 8px rgba(37,99,235,0.14);
    }

    .accordion-item {
        border: 3px solid #1f2937; /* gray-800 */
        background-color: #fffbeb; /* amber-50 */
        margin-bottom: 1rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
        transition: box-shadow 0.4s ease;
    }

    .accordion-item.active {
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    }

    .accordion-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 1rem 1.5rem;
        text-align: left;
        background-color: transparent;
        border: none;
        cursor: pointer;
        font-family: 'Oswald', sans-serif;
        font-size: 1.5rem;
        color: #1f2937;
        text-transform: uppercase;
        transition: background-color 0.2s ease;
    }

    .accordion-header:hover {
        background-color: #fef3c7; /* amber-100 */
    }

    .accordion-icon {
        width: 20px;
        height: 20px;
        position: relative;
        transition: transform 0.5s cubic-bezier(0.68, -0.6, 0.32, 1.6);
        flex-shrink: 0;
        margin-left: 1rem;
    }

    .accordion-icon::before,
    .accordion-icon::after {
        content: '';
        position: absolute;
        background-color: #b91c1c; /* red-700 */
        transition: transform 0.5s cubic-bezier(0.68, -0.6, 0.32, 1.6);
    }

    .accordion-icon::before {
        top: 50%;
        left: 0;
        width: 100%;
        height: 4px;
        transform: translateY(-50%);
    }

    .accordion-icon::after {
        top: 0;
        left: 50%;
        width: 4px;
        height: 100%;
        transform: translateX(-50%);
    }

    .accordion-item.active .accordion-header {
        background-color: #fde68a; /* amber-200 */
    }

    .accordion-item.active .accordion-icon {
        transform: rotate(225deg);
    }

    .accordion-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        background-color: #fffbeb; /* amber-50 */
    }

    .accordion-content .prose {
        padding: 0 1.5rem 1.5rem 1.5rem;
        font-family: 'Roboto Slab', serif;
        font-size: 1.125rem !important; /* 18px - größere Schriftgröße */
        line-height: 1.75 !important; /* besserer Zeilenabstand */
        opacity: 0;
        transform: translateY(-10px);
        transition: opacity 0.4s 0.2s ease-out, transform 0.4s 0.2s ease-out;
    }

    /* Größere Schrift für alle Textelemente in Accordion-Boxen */
    .accordion-content p {
        font-size: 1.125rem !important; /* 18px */
        line-height: 1.75 !important;
    }

    .accordion-content .text-sm {
        font-size: 1.0625rem !important; /* 17px statt 14px */
        line-height: 1.7 !important;
    }

    .accordion-content h4 {
        font-size: 1.25rem !important; /* 20px */
        line-height: 1.6 !important;
    }

    .accordion-content .prose p {
        font-size: 1.125rem !important; /* 18px */
        line-height: 1.75 !important;
    }

    .accordion-item.active .accordion-content .prose {
        opacity: 1;
        transform: translateY(0);
    }

    .text-stroke {
        -webkit-text-stroke: 2px #b91c1c;
        color: transparent;
        text-shadow: 3px 3px 0 rgba(185, 28, 28, 0.1);
    }

    .vintage-card {
        position: relative;
        overflow: hidden;
    }

    .vintage-card::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(
                45deg,
                transparent 45%,
                rgba(185, 28, 28, 0.03) 50%,
                transparent 55%
        );
        pointer-events: none;
    }

    .vintage-torn-edge {
        position: relative;
    }

    .vintage-torn-edge::before,
    .vintage-torn-edge::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        height: 15px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='15' viewBox='0 0 100 15'%3E%3Cpath d='M0,0 C20,5 30,15 50,15 C70,15 80,5 100,0 L100,15 L0,15 Z' fill='%23fffbeb'/%3E%3C/svg%3E");
        background-repeat: repeat-x;
        background-size: 100px 15px;
        pointer-events: none;
    }

    .vintage-torn-edge::before {
        top: -14px;
    }

    .vintage-torn-edge::after {
        bottom: -14px;
        transform: rotate(180deg);
    }

    .vintage-icon {
        background: #b91c1c;
        color: #fffbeb;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 900;
        border: 3px solid #fffbeb;
        box-shadow:
                0 4px 6px rgba(0,0,0,0.1),
                inset 0 2px 4px rgba(255,255,255,0.3);
    }

    @keyframes vintageGlow {
        0%, 100% { box-shadow: 0 0 20px rgba(185, 28, 28, 0.1); }
        50% { box-shadow: 0 0 40px rgba(185, 28, 28, 0.2); }
    }

    .vintage-glow {
        animation: vintageGlow 3s infinite;
    }

    .vintage-text {
        position: relative;
        display: inline-block;
    }

    .vintage-text::after {
        content: attr(data-text);
        position: absolute;
        left: 2px;
        top: 2px;
        color: rgba(185, 28, 28, 0.3);
        z-index: -1;
    }

    .hammer-sickle {
        position: relative;
        width: 24px;
        height: 24px;
    }

    .hammer-sickle::before {
        content: '⚒️';
        position: absolute;
        font-size: 20px;
        opacity: 0.8;
    }


    /* Mobile: Überschriften anpassen */
    @media (max-width: 767px) {
        /* Große Überschriften auf mobilen Geräten verkleinern */
        h1 {
            font-size: 2.5rem !important; /* 40px statt 48px+ */
            word-wrap: break-word;
            overflow-wrap: break-word;
            hyphens: manual; /* Ermöglicht manuelle Silbentrennung mit &shy; */
            -webkit-hyphens: manual;
            -moz-hyphens: manual;
        }

        h1.text-5xl,
        h1.md\:text-7xl {
            font-size: 2.5rem !important; /* 40px - größer für bessere Lesbarkeit */
            line-height: 1.2 !important;
            letter-spacing: -0.01em !important;
            word-break: break-word;
            overflow-wrap: break-word;
        }

        /* Text-Stroke auf Mobile reduzieren */
        .text-stroke {
            -webkit-text-stroke: 1.5px #b91c1c;
            font-size: 2.25rem !important; /* 36px */
            line-height: 1.2 !important;
        }

        /* Accordion-Titel auf Mobile anpassen */
        .accordion-header {
            font-size: 1.125rem !important; /* 18px statt 24px */
            padding: 0.75rem 1rem;
        }

        .accordion-title {
            font-size: 1rem !important;
            line-height: 1.3;
        }

        /* Vintage Badge kleiner auf Mobile */
        .vintage-badge {
            font-size: 1rem !important;
            width: 32px !important;
            height: 32px !important;
        }

        /* Container Padding reduzieren */
        .container {
            padding-left: 1rem;
            padding-right: 1rem;
        }

        /* Accordion Content Text auf Mobile */
        .accordion-content .prose {
            padding: 0 1rem 1rem 1rem;
            font-size: 1rem !important; /* 16px auf Mobile */
        }

        .accordion-content p {
            font-size: 1rem !important;
        }

        .accordion-content .text-sm {
            font-size: 0.9375rem !important; /* 15px */
        }

        .accordion-content h4 {
            font-size: 1.125rem !important; /* 18px */
        }

        /* Grid auf Mobile besser stapeln */
        .grid.grid-cols-1.md\:grid-cols-2,
        .grid.grid-cols-1.md\:grid-cols-3 {
            gap: 1rem;
        }

        /* Quote-Box auf Mobile anpassen */
        .mb-12.p-6 {
            padding: 1rem !important;
        }

        .mb-12.p-6 p {
            font-size: 1rem !important;
        }
    }

    /* Extra kleine Geräte (unter 380px) */
    @media (max-width: 380px) {
        h1.text-5xl,
        h1.md\:text-7xl {
            font-size: 1.875rem !important; /* 30px */
        }

        .text-stroke {
            font-size: 1.75rem !important; /* 28px */
        }

        .accordion-header {
            font-size: 1rem !important;
            padding: 0.625rem 0.75rem;
        }
    }
}