/* ============================================
   Chronological Age Calculator - Stylesheet
   ============================================ */

/* ========== CSS Variables ========== */
:root {
    --primary-color: #edb826;
    --secondary-color: #2b2b2b;
    --dark-color: #1a1a1a;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --error-color: #dc3545;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --border-radius-lg: 12px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-bg);
    overflow-x: hidden;
}

/* ========== Loading Animation ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-bg);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== Navigation Bar ========== */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-lg);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-decoration: none;
}

.logo i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary-color);
    cursor: pointer;
}

/* ========== Container ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== Hero Section ========== */
.hero-section {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--dark-color) 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23edb826" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,138.7C960,139,1056,117,1152,112C1248,107,1344,117,1392,122.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.3;
}

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

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
    opacity: 0.95;
}

/* ========== CTA Button ========== */
.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: var(--secondary-color);
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
    background: #f5c738;
}

/* ========== Ad Container ========== */
.ad-container {
    background: var(--light-bg);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    margin: 30px 0;
    color: var(--text-light);
    font-style: italic;
}

.ad-horizontal {
    min-height: 120px;
}

.ad-sidebar {
    min-height: 250px;
}

/* ========== Calculator Section ========== */
.calculator-section {
    padding: 60px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-light);
}

.calculator-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    margin: 0 auto;
}

/* ========== Form Styles ========== */
.calculator-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label i {
    color: var(--primary-color);
}

.form-group input[type="date"],
.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(237, 184, 38, 0.1);
}

.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.error-message {
    display: block;
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    min-height: 1.25rem;
}

/* ========== Button Styles ========== */
.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--secondary-color);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: #f5c738;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--light-bg);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--white);
    border-color: var(--primary-color);
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--secondary-color);
    transform: scale(1.1);
}

/* ========== Results Section ========== */
.results-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
    animation: slideUp 0.5s ease;
}

.results-section.hidden {
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.results-header h3 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-actions {
    display: flex;
    gap: 0.5rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-item {
    background: linear-gradient(135deg, var(--light-bg) 0%, var(--white) 100%);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 2px solid var(--border-color);
    transition: var(--transition);
    animation: fadeInUp 0.5s ease;
}

.result-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.result-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.result-unit {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.result-summary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #f5c738 100%);
    color: var(--secondary-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 1rem;
    box-shadow: var(--shadow-md);
}

/* ========== Content Section ========== */
.content-section {
    padding: 60px 0;
    background: var(--white);
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.main-content {
    order: 1;
}

.sidebar {
    order: 2;
}

.content-article {
    margin-bottom: 3rem;
}

.content-article h2 {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.content-article h3 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.content-article h4 {
    font-size: 1.25rem;
    color: var(--secondary-color);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.content-article p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.content-list {
    margin: 1rem 0 1rem 2rem;
    line-height: 1.8;
}

.content-list li {
    margin-bottom: 0.5rem;
}

.text-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.text-link:hover {
    text-decoration: underline;
}

.formula-box {
    background: var(--light-bg);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: var(--border-radius);
}

.comparison-table {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.comparison-item {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
}

.comparison-item h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.comparison-item ul {
    list-style: none;
    padding: 0;
}

.comparison-item li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.comparison-item li:last-child {
    border-bottom: none;
}

/* ========== Benefits Grid ========== */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.benefit-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.benefit-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.benefit-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.benefit-card h4 {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.benefit-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ========== FAQ Section ========== */
.faq-container {
    margin: 2rem 0;
}

.faq-item {
    background: var(--light-bg);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    overflow: hidden;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--primary-color);
}

.faq-question {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.faq-question i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.faq-question h3 {
    font-size: 1.125rem;
    color: var(--secondary-color);
    margin: 0;
}

.faq-answer {
    padding: 0 1.5rem 1.5rem 1.5rem;
}

.faq-answer p {
    color: var(--text-dark);
    line-height: 1.8;
}

/* ========== Sidebar ========== */
.sidebar-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-color);
}

.sidebar-card h3 {
    font-size: 1.25rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-card h3 i {
    color: var(--primary-color);
}

.sidebar-list {
    list-style: none;
    padding: 0;
}

.sidebar-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.sidebar-list i {
    color: var(--primary-color);
}

.share-buttons {
    display: flex;
    justify-content: space-around;
    gap: 0.5rem;
}

.share-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
    font-size: 1.125rem;
}

.share-btn.facebook { background: #3b5998; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.linkedin { background: #0077b5; }
.share-btn.whatsapp { background: #25d366; }

.share-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

/* ========== CTA Box ========== */
.cta-box {
    background: linear-gradient(135deg, var(--primary-color) 0%, #f5c738 100%);
    color: var(--secondary-color);
    padding: 3rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    margin: 3rem 0;
    box-shadow: var(--shadow-lg);
}

.cta-box h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cta-box p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

.cta-box .cta-button {
    background: var(--secondary-color);
    color: var(--white);
}

.cta-box .cta-button:hover {
    background: var(--dark-color);
}

/* ========== Page Header ========== */
.page-header {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--dark-color) 100%);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

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

.page-header p {
    font-size: 1.125rem;
    opacity: 0.9;
}

.page-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px;
}

/* ========== Contact Page ========== */
.contact-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.contact-form-section h2,
.contact-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.contact-form {
    margin-top: 2rem;
}

.contact-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-color);
}

.contact-info-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.contact-info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.contact-details h4 {
    color: var(--secondary-color);
    margin-bottom: 0.25rem;
}

.contact-details p {
    color: var(--text-light);
}

.social-links-large {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.success-message {
    background: var(--success-color);
    color: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin-top: 1rem;
    animation: slideUp 0.5s ease;
}

.success-message.hidden {
    display: none;
}

.success-message i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* ========== Footer ========== */
.footer {
    background: var(--secondary-color);
    color: var(--white);
    padding: 60px 0 20px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-column h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-logo i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.footer-description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
    font-size: 1.125rem;
}

.social-link:hover {
    background: var(--primary-color);
    color: var(--secondary-color);
    transform: translateY(-5px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* ========== Back to Top Button ========== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

/* ========== Animations ========== */
.fade-in {
    animation: fadeIn 0.8s ease;
}

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

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

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

/* ========== Responsive Design ========== */
@media (max-width: 968px) {
    .content-grid,
    .contact-layout,
    .comparison-table {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 3;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-description {
        font-size: 1.125rem;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 2rem;
        box-shadow: var(--shadow-lg);
        transition: left 0.3s ease;
        gap: 1rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .calculator-card {
        padding: 1.5rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group .btn {
        width: 100%;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .content-article h2 {
        font-size: 1.75rem;
    }

    .page-header h1 {
        font-size: 2rem;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .calculator-card {
        padding: 1rem;
    }

    .result-value {
        font-size: 1.5rem;
    }

    .cta-box {
        padding: 2rem 1rem;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* ========== Print Styles ========== */
@media print {
    .navbar,
    .hero-section,
    .ad-container,
    .sidebar,
    .footer,
    .back-to-top,
    .cta-box,
    .results-actions {
        display: none;
    }

    body {
        background: var(--white);
    }

    .calculator-card {
        box-shadow: none;
    }
}