/* --- 1. CORE TEMPLATE STYLES --- */
@charset "utf-8";
/* Use a CSS variable for the primary color for easier maintenance */
:root {
    --primary-color: #00d2ff;
    --secondary-color: #ffffff;
    --background-dark: #16213e;
    --background-gradient: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 15%, var(--background-dark) 35%, #0f3460 50%, #533a7d 70%, #8b5a8c 85%, #a0616a 100%);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background-gradient);
    min-height: 100vh; color: var(--secondary-color); overflow-x: hidden;
}

/* Animated Background - Optimization for PC */
.bg-shapes { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; overflow: hidden; }
.shape { position: absolute; background: rgba(255, 255, 255, 0.08); animation: float 12s ease-in-out infinite; box-shadow: 0 8px 32px rgba(255, 255, 255, 0.1); }
.shape:nth-child(1) { width: 120px; height: 80px; border-radius: 15px; top: 20%; left: 10%; transform: rotate(15deg); }
.shape:nth-child(2) { width: 90px; height: 140px; border-radius: 12px; top: 60%; right: 15%; animation-delay: 3s; transform: rotate(-20deg); }
.shape:nth-child(3) { width: 100px; height: 60px; border-radius: 10px; bottom: 20%; left: 20%; animation-delay: 6s; transform: rotate(25deg); }
.shape:nth-child(4) { width: 80px; height: 120px; border-radius: 8px; top: 10%; right: 30%; animation-delay: 9s; transform: rotate(-10deg); }
@keyframes float { 0%, 100% { transform: translateY(0px) rotate(0deg); } 50% { transform: translateY(-30px) rotate(180deg); } }

/* Accessibility Enhancement: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .shape { animation: none !important; }
}

/* Glass Utility */
.glass {
    background: rgba(255, 255, 255, 0.08); /* Slightly reduced opacity */
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15); /* Less strong border */
    border-radius: 20px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); /* Softer shadow */
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.content-wrapper { min-height: calc(100vh - 150px); padding-top: 20px; }

/* Navigation */
header { padding: 20px 0; position: sticky; top: 0; z-index: 1000; } /* Sticky header for better PC experience */
nav { display: flex; justify-content: space-between; align-items: center; padding: 15px 30px; } /* Slightly smaller padding */
.logo { font-size: 24px; font-weight: bold; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.nav-links { display: flex; gap: 10px; } /* Reduced gap for PC */
.nav-links a { color: rgba(255, 255, 255, 0.8); text-decoration: none; padding: 8px 15px; border-radius: 8px; transition: 0.3s; }
.nav-links a:hover, .nav-links a.active { background: rgba(255, 255, 255, 0.2); color: var(--secondary-color); }

/* Page System */
.page { display: none; animation: fadeIn 0.5s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- 2. CALCULATOR STYLES --- */
.calculator-wrapper {
    display: grid; grid-template-columns: 1fr; gap: 30px; max-width: 1100px; margin: 0 auto;
}
@media(min-width: 992px) { .calculator-wrapper { grid-template-columns: 4fr 5fr; } }

/* Top Tabs */
.calc-tabs { grid-column: 1 / -1; display: flex; justify-content: center; gap: 15px; margin-bottom: 20px; flex-wrap: wrap; }
.tab-btn {
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); color: rgba(255,255,255,0.7);
    padding: 12px 35px; /* Larger touch target for mobile */
    border-radius: 30px; cursor: pointer; font-size: 1rem; transition: 0.3s;
}
.tab-btn.active { background: #3a7bd5; color: var(--secondary-color); border-color: #3a7bd5; box-shadow: 0 0 15px rgba(58, 123, 213, 0.4); }

/* Input Section */
.input-card { padding: 30px; }
.sub-tabs { display: flex; gap: 10px; margin-bottom: 25px; background: rgba(0,0,0,0.2); padding: 5px; border-radius: 10px; }
.sub-tab-btn {
    flex: 1; background: transparent; border: none; color: rgba(255,255,255,0.7); padding: 10px 5px; /* Larger vertical padding for touch */
    border-radius: 8px; cursor: pointer; transition: 0.3s; font-size: 0.95rem;
}
.sub-tab-btn.active { background: rgba(255,255,255,0.15); color: var(--secondary-color); font-weight: 600; }

/* Input Groups with Sliders */
.input-group { margin-bottom: 30px; }
.label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.label-row label { color: rgba(255,255,255,0.9); font-size: 1rem; } /* Slightly larger text */

.input-box-wrapper {
    background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px;
    padding: 10px 15px; display: flex; align-items: center; width: 140px; /* Wider input box for better mobile input */
}
.input-box-wrapper input {
    background: transparent; border: none; color: var(--secondary-color); font-size: 1.1rem; width: 100%; text-align: right; outline: none;
    -moz-appearance: textfield; /* Remove number arrows in Firefox */
}
/* Remove number arrows in Webkit (Chrome, Safari) */
.input-box-wrapper input::-webkit-outer-spin-button,
.input-box-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0;
}

.currency-symbol { color: rgba(255,255,255,0.7); font-size: 1rem; margin-left: 5px; }

/* Range Slider Styling */
input[type=range] {
    -webkit-appearance: none; width: 100%; background: transparent; margin-top: 15px; /* Increased margin */
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; height: 20px; width: 20px; /* Larger thumb for touch */
    border-radius: 50%; background: var(--primary-color); cursor: pointer; margin-top: -8px; box-shadow: 0 0 10px rgba(0,210,255,0.5);
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%; height: 5px; /* Slightly thicker track */
    cursor: pointer; background: rgba(255,255,255,0.2); border-radius: 2px;
}

/* Pill Buttons for Frequency */
.freq-options { display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap; }
.freq-btn {
    padding: 8px 18px; /* Larger padding for touch */
    border-radius: 20px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7); cursor: pointer; font-size: 0.9rem; transition: 0.2s;
    flex-grow: 1; /* Allow stretching on mobile */
    min-width: 80px;
}
.freq-btn:hover { background: rgba(255,255,255,0.1); }
.freq-btn.active { background: var(--primary-color); color: var(--background-dark); border-color: var(--primary-color); font-weight: 600; }

/* Results Section */
.results-card { padding: 30px; display: flex; flex-direction: column; gap: 20px; }
.chart-container { position: relative; height: 220px; width: 100%; display: flex; justify-content: center; }
.line-chart-container { height: 160px !important; margin-top: 10px;} /* Tighter spacing */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 10px; }
.stat-box { background: rgba(0,0,0,0.2); padding: 15px; border-radius: 12px; text-align: center; }
.stat-label { font-size: 0.85rem; color: rgba(255,255,255,0.6); margin-bottom: 5px; }
.stat-val { font-size: 1.2rem; font-weight: 600; color: var(--secondary-color); }
.primary-color-text { color: var(--primary-color); }

/* Hidden Class */
.hidden { display: none !important; }

/* FAQ Styles */
.faq-container { margin-top: 30px; }
.faq-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0px;
}
.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-color);
    transition: color 0.2s;
}
.faq-question:hover {
    color: var(--secondary-color);
}
.faq-question .icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}
.faq-item.active .faq-question .icon {
    transform: rotate(45deg);
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 10px;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
}
.faq-answer p {
    padding-bottom: 15px;
    line-height: 1.6;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}
.faq-item.active .faq-answer {
    max-height: 500px;
    padding-top: 5px;
    padding-bottom: 15px;
}


/* Footer */
#footer { margin-top: 40px; padding: 20px 0; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; color: rgba(255,255,255,0.4); font-size: 0.9rem; }

/* --- Mobile Optimizations (Max 768px) --- */
@media (max-width: 768px) {
    .container { padding: 0 15px; } /* Slightly less padding on mobile edges */
    .calculator-wrapper { grid-template-columns: 1fr; }
    .freq-options { justify-content: space-between; }
    .freq-btn { flex-grow: 1; min-width: unset; } /* Distribute evenly */
    .input-box-wrapper { width: 120px; } /* Wider than original, but still compact */
    .nav-links { display: none; } /* Hide for simplified mobile nav */
    .input-card { padding: 20px; }
    .results-card { padding: 20px; }
    
    .chart-container { height: 200px; }
    .line-chart-container { height: 140px !important; }
}
