/**
 * Swiss MINT Lab - Gemeinsame Styles
 * Version: 2.0
 * Verwendet für alle Simulationen
 * 
 * Enthält: Base Styles, Header, Footer, Modals
 */

/* ========================================
   RESET & GRUNDLAGEN
   ======================================== */

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

/* ========================================
   TYPOGRAFIE
   ======================================== */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #1f2937;
    min-height: 100vh;
    margin: 0;
}

/* Hintergrund-Gradient */
body {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
}

/* Überschriften */
h1 {
    font-size: 1.875rem;  /* 30px */
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.5rem;  /* 24px */
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

h3 {
    font-size: 1.25rem;  /* 20px */
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

h4 {
    font-size: 1.125rem;  /* 18px */
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
}

/* ========================================
   LAYOUT
   ======================================== */

.container {
    max-width: 80rem;  /* 1280px */
    margin: 2rem auto;
    padding: 0 2rem;
}

.card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

/* ========================================
   BUTTONS
   ======================================== */

button {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.secondary {
    background: white;
    color: #3b82f6;
    border: 2px solid #3b82f6;
}

.secondary:hover:not(:disabled) {
    background: #eff6ff;
}

/* ========================================
   HILFSKLASSEN
   ======================================== */

.subtitle {
    color: #6b7280;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.text-small {
    font-size: 0.875rem;  /* 14px */
}

.text-tiny {
    font-size: 0.75rem;  /* 12px */
}

.text-large {
    font-size: 1.125rem;  /* 18px */
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

/* Farben */
.text-gray {
    color: #6b7280;
}

.text-gray-dark {
    color: #374151;
}

.text-green {
    color: #047857;
}

.text-blue {
    color: #2563eb;
}

/* ========================================
   GRIDS
   ======================================== */

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .grid-3 {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* ========================================
   FORMULARE
   ======================================== */

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="number"],
input[type="email"],
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.hidden {
    display: none !important;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

    .site-header {
        background: linear-gradient(135deg, #047857 0%, #059669 100%);
        color: white;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    
    .header-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 1rem 2rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .header-left {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    .logo svg {
        display: block;
    }
    
    .site-title h1 {
        font-size: 1.5rem;
        margin: 0;
        font-weight: bold;
    }
    
    .site-title .subtitle {
        font-size: 0.875rem;
        margin: 0;
        opacity: 0.9;
    }
    
    .main-nav > ul {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        gap: 2rem;
    }
    
    .main-nav a {
        color: white;
        text-decoration: none;
        font-weight: 500;
        padding: 0.5rem 1rem;
        border-radius: 0.375rem;
        transition: background 0.2s;
    }
    
    .main-nav a:hover,
    .main-nav a.active {
        background: rgba(255, 255, 255, 0.2);
    }
    
    /* ================================
    MODERNES DROPDOWN (Desktop)
    ================================ */

    .dropdown {
        position: relative;
    }

    /* Grundzustand */
    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;

        background: white;
        list-style: none;
        padding: 0.5rem 0;
        margin: 0;

        min-width: 240px;
        border-radius: 0.75rem;

        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);

        backdrop-filter: blur(6px);

        /* Animation */
        opacity: 0;
        transform: translateY(8px);
        pointer-events: none;

        transition: 
            opacity 0.25s ease,
            transform 0.25s ease;
    }

    /* Sichtbar bei Hover */
    .dropdown:hover .dropdown-menu {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    /* Menüeinträge */
    .dropdown-menu li {
        display: block;
    }

    .dropdown-menu li a {
        display: block;
        padding: 0.75rem 1.25rem;
        color: #047857;
        text-decoration: none;
        font-weight: 500;
        transition: background 0.2s ease, padding-left 0.2s ease;
    }

    /* Hover-Effekt für Items */
    .dropdown-menu li a:hover {
        background: #ecfdf5;
        padding-left: 1.5rem;
    }
    
    .mobile-menu-toggle {
        display: none;
        flex-direction: column;
        gap: 0.25rem;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.5rem;
    }
    
    .mobile-menu-toggle span {
        display: block;
        width: 25px;
        height: 3px;
        background: white;
        border-radius: 3px;
        transition: all 0.3s;
    }
    
    @media (max-width: 768px) {
        .header-container {
            padding: 1rem;
        }
        
        .site-title h1 {
            font-size: 1.25rem;
        }
        
        .site-title .subtitle {
            display: none;
        }
        
        .mobile-menu-toggle {
            display: flex;
        }
        
        .main-nav {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: #047857;
            padding: 1rem;
        }
        
        .main-nav.active {
            display: block;
        }
        
        .main-nav ul {
            flex-direction: column;
            gap: 0;
        }
        
        .dropdown-menu {
            position: static;
            display: none;
            background: rgba(255, 255, 255, 0.1);
            box-shadow: none;
            margin-top: 0.5rem;
        }
        
        .dropdown.active .dropdown-menu {
            display: block;
        }
        
        .dropdown-menu a {
            color: white;
        }
    }

/* ========================================
   FOOTER
   ======================================== */

    .site-footer {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
        color: #d1d5db;
        margin-top: 4rem;
    }
    
    .footer-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 3rem 2rem 1rem;
    }
    
    .footer-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 2rem;
        margin-bottom: 2rem;
    }
    
    .footer-section h3 {
        color: #10b981;
        font-size: 1.125rem;
        margin-bottom: 1rem;
        font-weight: 600;
    }
    
    .footer-section p {
        line-height: 1.6;
        margin: 0.5rem 0;
    }
    
    .footer-section ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .footer-section ul li {
        margin-bottom: 0.5rem;
    }
    
    .footer-section a {
        color: #d1d5db;
        text-decoration: none;
        transition: color 0.2s;
    }
    
    .footer-section a:hover {
        color: #34d399;
    }
    
    .footer-bottom {
        border-top: 1px solid #374151;
        padding-top: 1.5rem;
        text-align: center;
        font-size: 0.875rem;
    }
    
    .footer-bottom p {
        margin: 0.25rem 0;
    }
    
    .version {
        color: #9ca3af;
        font-size: 0.75rem;
    }
    
    @media (max-width: 768px) {
        .footer-container {
            padding: 2rem 1rem 1rem;
        }
        
        .footer-grid {
            grid-template-columns: 1fr;
            gap: 1.5rem;
        }
    }

/* ========================================
   MODALS
   ======================================== */

    .modal-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 9999;
        overflow-y: auto;
        padding: 2rem;
    }
    
    .modal-overlay.active {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .modal-content {
        background: white;
        border-radius: 1rem;
        max-width: 800px;
        width: 100%;
        max-height: 90vh;
        overflow-y: auto;
        position: relative;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    }
    
    .modal-header {
        padding: 2rem;
        border-bottom: 1px solid #e5e7eb;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        border-top: 4px solid #059669;
    }
    
    .modal-header h2 {
        margin: 0;
        color: #047857;
    }
    
    .modal-close {
        background: none;
        border: none;
        font-size: 2rem;
        cursor: pointer;
        color: #6b7280;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 0.5rem;
        transition: all 0.2s;
    }
    
    .modal-close:hover {
        background: #f3f4f6;
        color: #059669;
    }
    
    .modal-body {
        padding: 2rem;
    }
    
    .modal-body h3 {
        color: #047857;
        margin-top: 2rem;
        margin-bottom: 1rem;
    }
    
    .modal-body h3:first-child {
        margin-top: 0;
    }
    
    .modal-body p {
        line-height: 1.6;
        color: #4b5563;
        margin-bottom: 1rem;
    }
    
    .modal-body ul {
        padding-left: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .modal-body li {
        margin-bottom: 0.5rem;
        color: #4b5563;
        line-height: 1.6;
    }
    
    .modal-body a {
        color: #059669;
        text-decoration: none;
    }
    
    .modal-body a:hover {
        text-decoration: underline;
    }
    
    @media (max-width: 768px) {
        .modal-overlay {
            padding: 1rem;
        }
        
        .modal-header, .modal-body {
            padding: 1.5rem;
        }
    }
