/* ===========================
   Global Styles & Reset
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Modern Color Palette */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #14b8a6;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --success-color: #22c55e;
    --purple-accent: #a855f7;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-gradient-start: #0f172a;
    --bg-gradient-end: #1e293b;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --border-color: #334155;
    --border-radius: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(168, 85, 247, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(20, 184, 166, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

/* ===========================
   Animated Particles
   =========================== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.8), transparent);
    border-radius: 50%;
    animation: float-particle 20s infinite ease-in-out;
    opacity: 0;
}

.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 18s;
}

.particle:nth-child(2) {
    left: 30%;
    animation-delay: 4s;
    animation-duration: 22s;
}

.particle:nth-child(3) {
    left: 50%;
    animation-delay: 8s;
    animation-duration: 20s;
}

.particle:nth-child(4) {
    left: 70%;
    animation-delay: 12s;
    animation-duration: 24s;
}

.particle:nth-child(5) {
    left: 90%;
    animation-delay: 16s;
    animation-duration: 19s;
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px) scale(1.5);
        opacity: 0;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ===========================
   Header
   =========================== */
header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 24px;
    padding: 50px 40px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-glow), var(--shadow-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    to {
        left: 100%;
    }
}

.header-content {
    position: relative;
    z-index: 1;
}

.header-content i {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--purple-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f1f5f9, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ===========================
   Card Styles
   =========================== */
.card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 20px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), var(--purple-accent), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.2), var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.card:hover::before {
    opacity: 1;
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card h2 i {
    color: var(--primary-color);
    font-size: 1.3rem;
}

/* ===========================
   Calculator Grid
   =========================== */
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* ===========================
   Input Section
   =========================== */
.input-group {
    margin-bottom: 28px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
}

.label-text {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-text i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.label-hint {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

input[type="number"] {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition-fast);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-primary);
    font-weight: 500;
}

input[type="number"]:hover {
    border-color: rgba(99, 102, 241, 0.4);
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 0 20px rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

input[type="number"]::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* ===========================
   Buttons
   =========================== */
.btn-calculate {
    width: 100%;
    padding: 18px 35px;
    background: linear-gradient(135deg, var(--primary-color), var(--purple-accent));
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 35px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.btn-calculate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-calculate:hover::before {
    left: 100%;
}

.btn-calculate:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.4);
}

.btn-calculate:active {
    transform: translateY(-1px);
}

.btn-calculate:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-calculate .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn-secondary {
    padding: 12px 24px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

/* ===========================
   Results Section
   =========================== */
.result-main {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    backdrop-filter: blur(20px);
    border: 2px solid rgba(99, 102, 241, 0.3);
    color: white;
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.3), var(--shadow-lg);
}

.result-main::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.result-value {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.result-label {
    font-size: 1.1rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.result-number {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3)); }
    to { filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.6)); }
}

.result-breakdown {
    display: flex;
    justify-content: space-around;
    gap: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 25px;
    margin-top: 25px;
    position: relative;
    z-index: 1;
}

.breakdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.breakdown-item i {
    font-size: 1.8rem;
    opacity: 0.9;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

/* ===========================
   Recommendations
   =========================== */
.recommendations {
    background: rgba(20, 184, 166, 0.05);
    border: 1px solid rgba(20, 184, 166, 0.2);
    padding: 28px;
    border-radius: 16px;
    margin-bottom: 25px;
    backdrop-filter: blur(10px);
}

.recommendations h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recommendations h3 i {
    color: var(--accent-color);
}

.recommendation-list {
    list-style: none;
}

.recommendation-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: start;
    gap: 12px;
}

.recommendation-list li:last-child {
    border-bottom: none;
}

.recommendation-list li i {
    color: var(--secondary-color);
    margin-top: 3px;
}

.recommendation-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--secondary-color);
    color: white;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 8px;
}

.warning-badge {
    background: var(--accent-color);
}

.critical-badge {
    background: var(--danger-color);
}

/* ===========================
   Formula Display
   =========================== */
.formula-display {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 28px;
    border-radius: 16px;
    margin-bottom: 25px;
    backdrop-filter: blur(10px);
}

.formula-display h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.formula {
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid rgba(99, 102, 241, 0.3);
    color: #14b8a6;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
    text-align: center;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.formula code {
    font-size: 1.4rem;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(20, 184, 166, 0.5);
}

.formula-explanation {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.formula-values {
    margin-top: 15px;
    padding: 20px;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    box-shadow: inset 0 0 20px rgba(99, 102, 241, 0.1);
}

.formula-values p {
    margin: 5px 0;
    font-family: 'Courier New', monospace;
}

/* ===========================
   Enhancers Section
   =========================== */
.enhancers {
    border-top: 2px solid var(--border-color);
    padding-top: 25px;
}

.enhancers h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.enhancer-item {
    margin-bottom: 20px;
    padding: 18px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: var(--transition-fast);
}

.enhancer-item:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(30, 41, 59, 0.6);
}

.enhancer-item > label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
}

.enhancer-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
    transition: transform 0.2s ease;
}

.enhancer-item input[type="checkbox"]:hover {
    transform: scale(1.1);
}

.enhancer-item input[type="checkbox"]:checked {
    animation: checkbox-pop 0.3s ease;
}

@keyframes checkbox-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.enhancer-control {
    margin-top: 15px;
    padding: 18px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    box-shadow: inset 0 0 15px rgba(99, 102, 241, 0.1);
}

.enhancer-control label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 500;
}

.enhancer-control input[type="number"] {
    width: 100%;
    margin-bottom: 8px;
}

.enhancer-control .hint {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===========================
   Scenario Section
   =========================== */
.section-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.scenario-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.scenario-table-container {
    overflow-x: auto;
}

.scenario-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.scenario-table th,
.scenario-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.scenario-table th {
    background: rgba(99, 102, 241, 0.1);
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

.scenario-table tr:hover {
    background: rgba(99, 102, 241, 0.08);
    transform: scale(1.01);
    transition: var(--transition-fast);
}

.scenario-table .fte-cell {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.scenario-table .delete-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.scenario-table .delete-btn:hover {
    background: #dc2626;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

/* ===========================
   Info Section
   =========================== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.info-block h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.info-block p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.info-block ul {
    list-style: none;
    padding: 0;
}

.info-block ul li {
    padding: 8px 0;
    color: var(--text-secondary);
    display: flex;
    align-items: start;
    gap: 10px;
}

.info-block ul li::before {
    content: "→";
    color: var(--primary-color);
    font-weight: bold;
}

.info-block ul li strong {
    color: var(--text-primary);
}

/* ===========================
   Footer
   =========================== */
footer {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 40px;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 1024px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 25px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .result-number {
        font-size: 3rem;
    }
    
    .result-breakdown {
        flex-direction: column;
    }
    
    .scenario-controls {
        flex-direction: column;
    }
    
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* ===========================
   Animations
   =========================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease;
}

/* ===========================
   Notifications
   =========================== */
.notification {
    position: fixed;
    top: 20px;
    right: -400px;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    z-index: 10000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 300px;
}

.notification.show {
    right: 20px;
}

.notification i {
    font-size: 1.3rem;
}

.notification-success {
    border-color: rgba(34, 197, 94, 0.5);
}

.notification-success i {
    color: var(--success-color);
}

.notification-warning {
    border-color: rgba(245, 158, 11, 0.5);
}

.notification-warning i {
    color: var(--accent-color);
}

.notification-error {
    border-color: rgba(239, 68, 68, 0.5);
}

.notification-error i {
    color: var(--danger-color);
}

.notification-info {
    border-color: rgba(99, 102, 241, 0.5);
}

.notification-info i {
    color: var(--primary-color);
}

/* ===========================
   Utility Classes
   =========================== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}
