:root {
    --primary-color: #3a5a7d;
    --secondary-color: #5d89b3;
    --accent-color: #f4a261;
    --light-color: #f5f8fa;
    --dark-color: #2c3e50;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--light-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.header {
    padding: 2rem 0;
    text-align: center;
    position: relative;
}

.header h1 {
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 3rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header p {
    opacity: 0.9;
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Glassmorphism card style */
.glass-card {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
    padding: 2rem;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
}

.glass-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px 0 rgba(31, 38, 135, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.glass-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.75rem;
    text-align: center;
    font-weight: 600;
}

.icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 20px rgba(31, 38, 135, 0.15);
}

.reaction-icon {
    font-size: 2.5rem;
    color: white;
}

.glass-card p {
    flex-grow: 1;
    margin-bottom: 1.5rem;
    text-align: center;
    opacity: 0.9;
}

/* Form styles */
.form-label {
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.form-control, .form-select {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    padding: 0.7rem 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: white;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-select option {
    background: var(--dark-color);
    color: white;
}

/* Button styles */
.glass-btn {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(31, 38, 135, 0.15);
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 25px rgba(31, 38, 135, 0.25);
    color: white;
    transform: translateY(-2px);
}

.btn-primary {
    background: rgba(58, 90, 125, 0.8);
    border: 1px solid rgba(58, 90, 125, 0.9);
}

.btn-primary:hover {
    background: rgba(58, 90, 125, 1);
    border: 1px solid rgba(58, 90, 125, 1);
}

.btn-secondary {
    background: rgba(93, 137, 179, 0.8);
    border: 1px solid rgba(93, 137, 179, 0.9);
}

.btn-secondary:hover {
    background: rgba(93, 137, 179, 1);
    border: 1px solid rgba(93, 137, 179, 1);
}

/* Navigation styles */
.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    display: inline-block;
    margin: 0 0.5rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Footer styles */
.footer {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer a {
    color: white;
    opacity: 0.8;
    text-decoration: none;
    transition: opacity 0.3s;
}

.footer a:hover {
    opacity: 1;
}

/* GitHub corner */
.github-corner {
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
}

.github-corner svg {
    fill: rgba(255, 255, 255, 0.3);
    color: #764ba2;
    position: absolute;
    top: 0;
    border: 0;
    right: 0;
    transition: all 0.3s ease;
}

.github-corner:hover svg {
    fill: rgba(255, 255, 255, 0.5);
}

/* Theme toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 80px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 1000;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Dark theme */
[data-theme="dark"] {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
}

[data-theme="dark"] body {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

[data-theme="dark"] .glass-card {
    background: rgba(44, 62, 80, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .glass-card:hover {
    background: rgba(44, 62, 80, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .icon-wrapper {
    background: rgba(52, 73, 94, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .glass-btn {
    background: rgba(52, 73, 94, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .glass-btn:hover {
    background: rgba(52, 73, 94, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .form-control, [data-theme="dark"] .form-select {
    background: rgba(44, 62, 80, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .form-control:focus, [data-theme="dark"] .form-select:focus {
    background: rgba(44, 62, 80, 0.6);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Output styles */
.output-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    font-family: 'Courier New', monospace;
    color: #00ff00;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.output-area {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 1.5rem;
    font-family: 'Courier New', Courier, monospace;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Form-specific styles */
.form-text {
    color: rgba(255, 255, 255, 0.7);
}

.form-select option {
    background: var(--dark-color);
    color: white;
}

/* Custom tooltip */
.custom-tooltip {
    position: relative;
    display: inline-block;
}

.custom-tooltip .tooltip-text {
    visibility: hidden;
    width: 250px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    line-height: 1.4;
}

.custom-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.custom-tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
}

.tooltip-inner {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    padding: 8px 12px;
    max-width: 300px;
}

/* Action buttons */
.action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 50px;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Home link styles */
.home-link {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 50px;
    padding: 0.5rem 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    z-index: 1000;
    font-weight: 500;
}

.home-link:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

/* Potential card styles */
.potential-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.potential-card h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.add-potential-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px dashed rgba(255, 255, 255, 0.4);
    color: white;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    margin-top: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-potential-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.remove-potential {
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-potential:hover {
    color: white;
}

.copy-btn {
    background: rgba(76, 175, 80, 0.8);
    border: 1px solid rgba(76, 175, 80, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: rgba(76, 175, 80, 1);
    transform: translateY(-1px);
}

/* Responsive design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2.5rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .glass-card {
        margin-bottom: 2rem;
    }
    
    .github-corner {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 576px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 0.9rem;
        padding: 0 1rem;
    }
    
    .glass-card {
        padding: 1.5rem;
    }
    
    .icon-wrapper {
        width: 60px;
        height: 60px;
    }
    
    .reaction-icon {
        font-size: 2rem;
    }
    
    .github-corner {
        width: 50px;
        height: 50px;
    }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        top: 15px;
        right: 60px;
    }
    
    .home-link {
        top: 15px;
        left: 15px;
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* Advanced FRESCO Parameters styling */
.advanced-fresco-card {
    background: rgba(139, 69, 19, 0.25) !important; /* Saddle brown tint */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(210, 180, 140, 0.4) !important; /* Tan border */
    box-shadow: 0 8px 32px 0 rgba(139, 69, 19, 0.2) !important;
}

.advanced-fresco-card:hover {
    background: rgba(139, 69, 19, 0.3) !important;
    border: 1px solid rgba(210, 180, 140, 0.6) !important;
    box-shadow: 0 15px 30px 0 rgba(139, 69, 19, 0.3) !important;
}

.advanced-fresco-card h3 {
    color: #f4f1de !important; /* Warm white */
    border-bottom: 1px solid rgba(210, 180, 140, 0.3) !important;
}

.advanced-fresco-card .glass-btn {
    background: rgba(160, 82, 45, 0.3) !important; /* Saddle brown variant */
    border: 1px solid rgba(210, 180, 140, 0.4) !important;
    color: #f4f1de !important;
}

.advanced-fresco-card .glass-btn:hover {
    background: rgba(160, 82, 45, 0.5) !important;
    border: 1px solid rgba(210, 180, 140, 0.6) !important;
    transform: translateY(-2px);
}

.advanced-fresco-card .glass-btn.active {
    background: rgba(139, 69, 19, 0.6) !important;
    border: 1px solid rgba(210, 180, 140, 0.8) !important;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.4) !important;
}

/* Namelist section styling */
.namelist-section .glass-card {
    background: rgba(101, 67, 33, 0.2) !important; /* Darker brown for subsections */
    border: 1px solid rgba(210, 180, 140, 0.3) !important;
}

.namelist-section .glass-card h4 {
    color: #e9c46a !important; /* Warm yellow */
    border-bottom: 1px solid rgba(210, 180, 140, 0.2) !important;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}