/* CSS Reset and Base Styles */
:root {
    --primary-color: #4a6fa5;
    --secondary-color: #6b8cbc;
    --accent-color: #ff9a3c;
    --light-color: #f8f9fa;
    --dark-color: #1a1a2e;
    --text-light: #f8f9fa;
    --text-dark: #333;
    --bg-light: #ffffff;
    --bg-dark: #0d1117;
    --card-light: #f8f9fa;
    --card-dark: #161b22;
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dark-mode {
    --bg-color: var(--bg-dark);
    --text-color: var(--text-light);
    --card-bg: var(--card-dark);
}

.light-mode {
    --bg-color: var(--bg-light);
    --text-color: var(--text-dark);
    --card-bg: var(--card-light);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: var(--transition);
    overflow-x: hidden;
    position: relative;
}

/* Night Sky Background */
.night-sky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(to bottom, #0d1b2a, #1b263b, #415a77);
    transition: var(--transition);
}

.moon {
    position: absolute;
    top: 10%;
    right: 15%;
    width: 80px;
    height: 80px;
    background: #f5f5f5;
    border-radius: 50%;
    box-shadow: 0 0 40px 10px rgba(255, 255, 255, 0.5);
    transition: var(--transition);
}

.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    animation: twinkle 5s infinite;
}

.star.small {
    width: 2px;
    height: 2px;
}

.star.medium {
    width: 3px;
    height: 3px;
}

.star.large {
    width: 4px;
    height: 4px;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

/* Falling Stars Animation */
.falling-star {
    position: absolute;
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, transparent, white, transparent);
    border-radius: 50%;
    animation: fall linear forwards;
    opacity: 0;
    z-index: -1;
}

@keyframes fall {
    0% {
        transform: translateY(-100px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(var(--end-x, 100px)) rotate(360deg);
        opacity: 0;
    }
}

/* Different falling star styles */
.falling-star.fast {
    height: 15px;
    animation-duration: 2s;
}

.falling-star.medium {
    height: 25px;
    animation-duration: 4s;
}

.falling-star.slow {
    height: 30px;
    animation-duration: 6s;
}

.falling-star.long {
    height: 40px;
    animation-duration: 8s;
}

.falling-star.extra-slow {
    height: 35px;
    animation-duration: 10s;
}

/* Header and Navigation */
header {
    background-color: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-light);
    display: flex;
    align-items: center;
}

.logo span {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-color);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 20px;
}

.theme-toggle:hover {
    color: var(--accent-color);
    transform: rotate(30deg);
}

.mobile-menu {
    display: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
}

/* Hero Section */
.hero {
    padding: 150px 0 100px;
    text-align: center;
    color: var(--text-light);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.cta-button:hover {
    background-color: #ff8a1c;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Tool Section */
.tool-section {
    padding: 80px 0;
    background-color: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    margin: 40px auto;
    max-width: 900px;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-light);
    font-size: 2.2rem;
}

.calculator-container {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    backdrop-filter: blur(10px);
}

.calculator-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-light);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(255, 154, 60, 0.3);
}

.calculate-btn {
    grid-column: 1 / -1;
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 15px;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.calculate-btn:hover {
    background-color: #ff8a1c;
    transform: translateY(-2px);
}

.results {
    display: none;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-top: 20px;
}

.results h3 {
    color: var(--text-light);
    margin-bottom: 15px;
    text-align: center;
}

.sleep-times {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.sleep-time-card {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 15px;
    text-align: center;
    transition: var(--transition);
}

.sleep-time-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.sleep-time-card h4 {
    color: var(--text-light);
    margin-bottom: 10px;
}

.sleep-time-card p {
    color: var(--accent-color);
    font-size: 1.2rem;
    font-weight: 600;
}

/* About Section */
.about-section {
    padding: 80px 0;
    color: var(--text-light);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.about-text h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
}

.about-text p {
    margin-bottom: 15px;
    opacity: 0.9;
}

.about-image {
    text-align: center;
}

.about-image img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* FAQ Section */
.faq-section {
    padding: 80px 0;
    color: var(--text-light);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 15px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.05);
}

.faq-question {
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    transition: var(--transition);
}

.faq-question:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer.active {
    padding: 20px;
    max-height: 500px;
}

.faq-toggle {
    font-size: 1.2rem;
    transition: var(--transition);
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

/* Footer */
footer {
    background-color: rgba(13, 17, 23, 0.9);
    color: var(--text-light);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 {
    margin-bottom: 20px;
    font-size: 1.3rem;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent-color);
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: block;
}

.footer-logo span {
    color: var(--accent-color);
}

.footer-column p {
    margin-bottom: 20px;
    opacity: 0.8;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    opacity: 0.8;
}

.footer-links a:hover {
    color: var(--accent-color);
    opacity: 1;
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.social-icon:hover {
    background-color: var(--accent-color);
    transform: translateY(-5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
}

/* Page Section Styles */
.page-section {
    padding: 150px 0 80px;
    color: var(--text-light);
}

.page-header {
    text-align: center;
    margin-bottom: 60px;
}

.page-header h1 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.page-header p {
    font-size: 1.2rem;
    opacity: 0.8;
}

.page-content {
    max-width: 900px;
    margin: 0 auto;
}

.content-block {
    margin-bottom: 50px;
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
}

.content-block h2 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.content-block h3 {
    color: var(--text-light);
    margin: 25px 0 15px;
    font-size: 1.3rem;
}

.content-block p {
    margin-bottom: 15px;
    line-height: 1.7;
}

.content-block ul, .content-block ol {
    margin: 20px 0;
    padding-left: 30px;
}

.content-block li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.content-block strong {
    color: var(--accent-color);
}

/* Values Grid */
.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.value-item {
    padding: 25px;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-color);
}

.value-item h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

/* Contact Page Styles */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-form-container {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
}

.contact-form-container h2 {
    margin-bottom: 30px;
    color: var(--accent-color);
}

.contact-form .form-group {
    margin-bottom: 25px;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-light);
    font-weight: 500;
}

.contact-form .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 1rem;
    transition: var(--transition);
}

.contact-form textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.contact-form .form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(255, 154, 60, 0.3);
}

.contact-info h2 {
    margin-bottom: 30px;
    color: var(--accent-color);
}

.contact-methods {
    margin-bottom: 40px;
}

.contact-method {
    margin-bottom: 30px;
    padding: 25px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
}

.contact-method h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.contact-method a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.contact-method a:hover {
    color: var(--accent-color);
}

.faq-preview {
    padding: 25px;
    background-color: rgba(255, 154, 60, 0.1);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-color);
}

.faq-preview h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
}

.faq-preview a {
    color: var(--accent-color);
    text-decoration: none;
}

.faq-preview a:hover {
    text-decoration: underline;
}

/* Warning Note */
.warning-note {
    background-color: rgba(255, 87, 87, 0.1);
    border-left: 4px solid #ff5757;
}

.warning-note h2 {
    color: #ff5757;
}

/* Responsive Design */
@media (max-width: 992px) {
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .values-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(26, 26, 46, 0.95);
        flex-direction: column;
        padding: 20px;
        text-align: center;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links li {
        margin: 10px 0;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .calculator-form {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .page-header h1 {
        font-size: 2.2rem;
    }
    
    .content-block {
        padding: 20px;
    }
    
    .contact-form-container {
        padding: 30px 20px;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .sleep-times {
        grid-template-columns: 1fr;
    }
    
    .page-section {
        padding: 130px 0 60px;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .content-block {
        padding: 15px;
    }
}

/* Reset Button Styles */
.reset-btn {
    grid-column: 1 / -1;
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 15px;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
}

.reset-btn:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}