:root {
    --bg-color: #0f111a;
    --text-main: #ffffff;
    --text-muted: #94a1b2;
    --primary-color: #7f5af0;
    --primary-hover: #6943db;
    --accent-color: #2cb67d;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Background Glow Effects */
.glow-bg {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(127, 90, 240, 0.15) 0%, rgba(15, 17, 26, 0) 70%);
    border-radius: 50%;
    z-index: -1;
}

.glow-bg::after {
    content: '';
    position: absolute;
    bottom: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(44, 182, 125, 0.1) 0%, rgba(15, 17, 26, 0) 70%);
    border-radius: 50%;
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 0 20px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Global Navigation */
.global-nav {
    width: 100%;
    background: rgba(15, 17, 26, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo i {
    color: var(--primary-color);
}

.nav-logo span {
    color: var(--accent-color);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

/* Header */
.app-header {
    text-align: center;
    padding: 50px 20px 30px;
}

.app-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.app-header h1 i {
    color: var(--primary-color);
}

.app-header h1 span {
    color: var(--accent-color);
}

.app-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--glass-shadow);
}

.glass-panel-inner {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Calculator Form */
.calculator-card {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-group label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
}

input[type="date"] {
    width: 100%;
    padding: 15px 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s ease;
}

input[type="date"]:hover, input[type="date"]:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

/* To invert the calendar icon on webkit browsers for dark mode */
::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 18px 30px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(127, 90, 240, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Results Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay.hidden {
    display: none;
}

/* Results Section inside Modal */
.result-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    max-height: 90vh;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-main);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: var(--primary-color);
    transform: rotate(90deg);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.result-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 25px;
}

.main-result {
    display: flex;
    justify-content: space-around;
    gap: 15px;
    margin-bottom: 30px;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(127, 90, 240, 0.1);
    border: 1px solid rgba(127, 90, 240, 0.3);
    padding: 20px 15px;
    border-radius: 15px;
    min-width: 110px;
    transition: transform 0.3s ease;
}

.time-block:hover {
    transform: translateY(-5px);
}

.time-block .number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 5px;
}

.time-block:nth-child(2) .number {
    color: var(--accent-color);
}

.time-block:nth-child(2) {
    background: rgba(44, 182, 125, 0.1);
    border-color: rgba(44, 182, 125, 0.3);
}

.time-block:nth-child(3) .number {
    color: #ff8906; /* Third accent color */
}

.time-block:nth-child(3) {
    background: rgba(255, 137, 6, 0.1);
    border-color: rgba(255, 137, 6, 0.3);
}

.time-block .label {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Fun Facts */
.fun-facts h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
}

.stats-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stats-list li {
    font-size: 1rem;
    color: var(--text-muted);
}

.stats-list span {
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Ad Slots Placholders */
.ad-slot {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 0.9rem;
    text-align: center;
    overflow: hidden;
}

.top-ad {
    width: 100%;
    height: 90px;
    max-width: 728px;
    margin: 0 auto;
}

.square-ad {
    width: 100%;
    height: 250px;
    max-width: 300px;
    margin: 0 auto;
}

/* SEO Content Area */
.seo-content {
    padding: 30px 40px;
}

.seo-content h2, .seo-content h3 {
    color: var(--text-main);
    margin: 20px 0 10px;
}

.seo-content h2:first-child {
    margin-top: 0;
}

.seo-content p {
    color: var(--text-muted);
    margin-bottom: 15px;
}

/* Footer */
footer {
    margin-top: auto;
    padding: 30px 20px;
    text-align: center;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 600px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .glass-panel {
        padding: 30px 20px;
    }
    
    .app-header h1 {
        font-size: 2.2rem;
    }
    
    .result-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .main-result {
        flex-direction: column;
        align-items: stretch;
    }
    
    .time-block {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
    }

    .time-block .number {
        font-size: 2rem;
        margin-bottom: 0;
    }
    
    .stats-list {
        grid-template-columns: 1fr;
    }

    .close-btn {
        top: 10px;
        right: 10px;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pop-animation .time-block {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.pop-animation .time-block:nth-child(1) { animation-delay: 0.1s; }
.pop-animation .time-block:nth-child(2) { animation-delay: 0.2s; }
.pop-animation .time-block:nth-child(3) { animation-delay: 0.3s; }

.pop-animation .fun-facts {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.4s;
}
