/* ==========================================================================
   NSL Unified Design System
   ========================================================================== */

/* --- 1. Variables & Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap');

:root {
    /* Brand Colors */
    --nsl-red: #cc1f1f;
    --nsl-gold: #f2a900;
    --nsl-navy: #1a3c6e;
    --nsl-navy-dark: #151b29;
    --nsl-green: #27ae60;
    
    /* Grays */
    --bg-light: #fdfdfd;
    --bg-gray: #f5f5f5;
    --text-main: #333333;
    --text-muted: #666666;
    --border-color: #eeeeee;

    /* Spacing & Radii */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 24px;
    --radius-pill: 50px;
    
    --shadow-sm: 0 4px 15px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Background Pattern (Subtle) */
.bg-pattern {
    background-image: 
        radial-gradient(at 0% 0%, rgba(204, 31, 31, 0.04) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(242, 169, 0, 0.04) 0px, transparent 50%),
        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='%23000000' fill-opacity='0.02'%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");
    background-attachment: fixed;
}

/* --- 2. Layouts --- */
.container {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px 60px;
    width: 100%;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* --- 3. Wavy Headers & Footers --- */
.wavy-header {
    width: 100%;
    height: 180px;
    position: relative;
    background: transparent;
}
.wavy-header svg {
    display: block;
    width: 100%;
    height: 100%;
}

.wavy-footer {
    width: 100%;
    height: 70px;
    margin-top: auto;
    background: transparent;
}
.wavy-footer svg {
    display: block;
    width: 100%;
    height: 100%;
}

.header-controls {
    position: absolute;
    top: 20px;
    right: 40px;
    z-index: 1000;
    display: flex;
    gap: 15px;
    align-items: center;
}

/* --- 4. Cards & Panels --- */
.card {
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.section-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 40px;
    margin-bottom: 50px;
}
.section-title {
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 20px;
    color: var(--nsl-gold);
    text-transform: uppercase;
}

/* --- 5. Buttons --- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background-color: var(--nsl-navy);
    color: #ffffff;
}
.btn-primary:hover {
    background-color: var(--nsl-navy-dark);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--nsl-navy);
    color: var(--nsl-navy);
}
.btn-outline:hover {
    background-color: var(--nsl-navy);
    color: #ffffff;
}

.btn-red {
    background-color: var(--nsl-red);
    color: #ffffff;
}
.btn-red:hover {
    background-color: #a81919;
}

.btn-pill {
    padding: 18px 80px;
    border-radius: var(--radius-pill);
    font-size: 20px;
    font-weight: 900;
    text-transform: uppercase;
}

/* Header Action Links (Logout, Trash, Lang) */
.header-link {
    padding: 8px 16px;
    background: rgba(255,255,255,0.15);
    color: #ffffff;
    border: 2px solid rgba(255,255,255,0.8);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}
.header-link:hover {
    background: #ffffff;
    color: var(--nsl-red);
}

/* --- 6. Forms & Inputs --- */
.form-group {
    margin-bottom: 20px;
}
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    font-weight: 600;
    transition: border-color 0.2s ease;
    outline: none;
}
.form-control:focus {
    border-color: var(--nsl-gold);
}

/* --- 7. Tables --- */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}
.nsl-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}
.nsl-table th {
    text-align: left;
    padding: 15px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    border-bottom: 2px solid var(--border-color);
}
.nsl-table td {
    padding: 15px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.nsl-table tr:nth-child(even) {
    background-color: var(--bg-gray);
}

/* --- 8. Badges --- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-danger { background: #ffebee; color: #c62828; }
.badge-warning { background: #fff3e0; color: #ef6c00; }
.badge-neutral { background: #f0f0f0; color: #666666; }

/* --- 9. Toasts --- */
.toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: var(--text-main);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
}
.toast.success { background: var(--nsl-green); }
.toast.error { background: var(--nsl-red); }

@keyframes toastIn { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateY(0); opacity: 1; } to { transform: translateY(20px); opacity: 0; } }

/* --- 10. Brand Logo in Nav --- */
.nav-brand-logo {
    height: 100px;
    margin-top: -5px;
    margin-bottom: 20px;
    display: block;
}

/* --- 11. Utilities --- */
.text-center { text-align: center; }
.mt-2 { margin-top: 10px; }
.mt-4 { margin-top: 20px; }
.mb-2 { margin-bottom: 10px; }
.mb-4 { margin-bottom: 20px; }
.flex { display: flex; }
.gap-2 { gap: 10px; }
.gap-4 { gap: 20px; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.hidden { display: none !important; }

/* --- 12. NSL Branded Tabs (German Flag Theme) --- */
.nsl-tabs {
    display: flex;
    justify-content: center;
    border-bottom: 3px solid var(--text-main); /* Black base */
    margin-bottom: 30px;
    gap: 10px;
}
.nsl-tab-btn {
    background: transparent;
    border: none;
    font-size: 16px;
    font-weight: 800;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-muted);
    padding: 12px 24px;
    cursor: pointer;
    position: relative;
    text-transform: uppercase;
    transition: color 0.3s ease;
}
.nsl-tab-btn:hover {
    color: var(--text-main);
}
.nsl-tab-btn.active {
    color: var(--text-main); /* Black text */
}
.nsl-tab-btn::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    transition: background 0.3s ease;
}
/* German flag colors for the 3 tabs */
.nsl-tab-btn:nth-child(1).active::after { background: var(--text-main); /* Black */ }
.nsl-tab-btn:nth-child(2).active::after { background: var(--nsl-red); /* Red */ }
.nsl-tab-btn:nth-child(3).active::after { background: var(--nsl-gold); /* Gold */ }

.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* --- 13. NSL Partner Masonry & Admin Dense Tables --- */
.nsl-grid-card {
    background: #ffffff;
    border: 2px solid var(--text-main);
    border-radius: var(--radius-sm);
    box-shadow: 4px 4px 0px var(--text-main);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    --card-hover-color: var(--nsl-red);
}
.nsl-grid-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--card-hover-color);
}
.nsl-grid-header {
    border-bottom: 2px solid var(--text-main);
    padding: 15px;
    display: flex;
    align-items: center;
    background: var(--bg-gray);
}
.nsl-sticky-table {
    border: 2px solid var(--text-main);
}
.nsl-sticky-table th {
    background: var(--text-main);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: none;
}
.nsl-sticky-table td {
    border-bottom: 1px solid var(--text-main);
    border-right: 1px solid var(--border-color);
}
.nsl-sticky-table tr:hover {
    background-color: #fffdf5; /* Light gold tint */
}



/* --- 14. Mobile Responsiveness --- */
@media (max-width: 768px) {
    .container {
        padding: 0 15px 30px;
    }
    .wavy-header {
        height: 120px;
    }
    .header-controls {
        top: 10px;
        right: 15px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .nav-brand-logo {
        height: 60px;
        margin-bottom: 10px;
    }
    .section-card {
        padding: 20px;
    }
    .section-title {
        font-size: 22px;
    }
    .btn-pill {
        padding: 15px 40px;
        font-size: 16px;
    }
    .nsl-tabs {
        flex-wrap: wrap;
    }
    .nsl-tab-btn {
        padding: 10px 15px;
        font-size: 14px;
        flex: 1 1 auto;
        text-align: center;
    }
    .auth-container .card {
        width: 100%;
        max-width: 100%;
        margin: 0 10px;
    }
}

    .grid { grid-template-columns: 1fr; }



/* --- 7. Buttons --- */
.btn-nsl-brutal {
    padding: 12px;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    border: 2px solid var(--text-main);
    color: var(--text-main);
    background: transparent;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-nsl-brutal.primary { background: var(--text-main); color: #fff; }
.btn-nsl-brutal.active { background: var(--text-main); color: #fff; }
.btn-nsl-brutal:hover {
    box-shadow: 4px 4px 0px var(--nsl-red);
    transform: translate(-2px, -2px);
}


.nav-brand-logo { height: 90px; margin-top: 10px; margin-bottom: 25px; }

