/* CSS Variables for Theme */
:root {
    /* Color Palette */
    --primary: #0F52BA; /* Sapphire Blue */
    --primary-light: #4175DF;
    --secondary: #008957; /* Slightly darker jade for better contrast */
    --accent: #E64A19; /* More visible accent */
    
    /* Neutral Colors / Dark Mode base ready */
    --bg-main: #F8FAFC; 
    --bg-card: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #475569; /* Increased contrast from #5E6A82 */
    --border-color: #E2E8F0;
    
    /* Layout */
    --border-radius: 16px;
    --transition-speed: 0.3s;
    --max-width: 1200px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, .logo {
    font-family: 'Outfit', sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 5%;
}

/* Header */
.main-header {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.main-header.scrolled {
    padding: 5px 0;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.main-header.scrolled .header-container {
    height: 65px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

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

.logo-icon {
    color: var(--primary);
    font-size: 1.8rem;
}

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

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--bg-main);
    border-radius: 50px;
    padding: 8px 16px;
    width: 350px;
    border: 1px solid transparent;
    transition: all var(--transition-speed);
}

.search-bar:focus-within {
    border-color: var(--primary);
    background-color: white;
    box-shadow: 0 4px 12px rgba(15, 82, 186, 0.1);
}

.search-bar ion-icon {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-right: 8px;
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-main);
}

.main-nav {
    display: flex;
    gap: 24px;
}

.main-nav a {
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition-speed);
    position: relative;
}

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

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary);
    border-radius: 3px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-main);
    cursor: pointer;
}

/* Hero Section */
.hero {
    padding: 80px 0 60px;
    text-align: center;
}

.hero .badge {
    display: inline-block;
    background-color: rgba(15, 82, 186, 0.1);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
    color: var(--text-main);
}

.hero h1 span {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 24px;
}

.hero-author {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--text-main);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.hero-author ion-icon, .biomed-icon {
    color: var(--primary);
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.hero-author strong {
    color: var(--primary);
    font-weight: 700;
}

/* AdSense Placeholders */
.adsense-container {
    margin: 30px auto 40px;
    clear: both;
}

.adsense-placeholder {
    width: 100%;
    min-height: 90px;
    background-color: #f1f5f9;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ad-label {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-bottom: 5px;
    text-align: center;
    width: 100%;
}

.ad-sidebar {
    width: 300px;
    min-height: 600px;
    margin: 20px 0;
}

/* Articles Section */
.articles-section {
    padding: 60px 0;
    background-color: white;
    border-top: 1px solid var(--border-color);
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.article-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    background-color: var(--bg-main);
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
    border: 1px solid transparent;
}

.article-card:hover {
    background-color: white;
    border-color: var(--primary-light);
    box-shadow: 0 10px 20px rgba(15, 82, 186, 0.05);
    transform: translateY(-3px);
}

.article-thumb {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-info h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.article-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

/* Calculators Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

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

.filters {
    display: flex;
    gap: 12px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background-color: white;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: var(--text-muted);
    transition: all var(--transition-speed);
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(15, 82, 186, 0.2);
}

/* Grid layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

/* Calculators Cards */
.calc-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(28, 39, 76, 0.05);
    border: 1px solid var(--border-color);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.calc-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 35px rgba(28, 39, 76, 0.1);
}

.card-image {
    position: relative;
    height: 200px;
    width: 100%;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.calc-card:hover .card-image img {
    transform: scale(1.08); /* Zoom effect on image via hover */
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.5) 100%);
    z-index: 1;
}

.category-tag {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    z-index: 2;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.category-tag.nutrition {
    background-color: rgba(0, 168, 107, 0.85); /* Green */
}

.category-tag.sports {
    background-color: rgba(15, 82, 186, 0.85); /* Blue */
}

.card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-content h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
    transition: color var(--transition-speed);
}

.calc-card:hover .card-content h3 {
    color: var(--primary);
}

.card-content p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    flex-grow: 1; /* Push footer down */
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.author ion-icon {
    color: var(--secondary);
    font-size: 1.1rem;
}

.go-icon {
    font-size: 1.4rem;
    color: var(--primary);
    transition: transform var(--transition-speed);
}

.calc-card:hover .go-icon {
    transform: translateX(4px);
}

/* CTA Buttons in cards */
.btn-card-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--primary);
    color: white !important;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 10px;
    transition: all var(--transition-speed);
    border: none;
    width: 100%;
}

.btn-card-cta:hover {
    background-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(15, 82, 186, 0.2);
}

.btn-card-cta ion-icon {
    font-size: 1.2rem;
}

/* Footer Section */
.main-footer {
    background-color: #111827; /* Dark grayish blue */
    color: #f8fafc;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 2fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .logo {
    color: white;
    margin-bottom: 16px;
}

.footer-brand p {
    color: #94a3b8;
    max-width: 300px;
}

.footer-links {
    display: flex;
    justify-content: space-around;
}

.link-group h4 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: white;
}

.link-group a {
    display: block;
    color: #94a3b8;
    margin-bottom: 12px;
    transition: color var(--transition-speed);
}

.link-group a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 20px;
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
}

/* Developer Profile Section */
.developer-profile {
    background: linear-gradient(to bottom, var(--bg-main) 0%, white 100%);
    padding: 60px 0 80px;
    border-top: 1px solid var(--border-color);
}

.profile-container {
    display: flex;
    align-items: center;
    gap: 30px;
    max-width: 850px;
    margin: 0 auto;
    background-color: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 15px 35px rgba(28, 39, 76, 0.06);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.profile-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
}

.profile-avatar {
    width: 110px;
    height: 110px;
    background: linear-gradient(135deg, rgba(15, 82, 186, 0.1) 0%, rgba(0, 168, 107, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    color: var(--primary);
    font-size: 3.5rem;
    box-shadow: inset 0 0 0 2px rgba(15, 82, 186, 0.2);
    overflow: hidden; /* Added to keep image inside the circle */
}

/* New specific rule for the actual image */
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    flex-grow: 1;
}

.profile-info h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
    font-family: 'Inter', sans-serif;
}

.profile-info h3 {
    font-size: 1.8rem;
    color: var(--text-main);
    margin-bottom: 8px;
    font-weight: 700;
}

.profile-credentials {
    font-weight: 600;
    color: var(--secondary);
    font-size: 1.05rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-credentials::before {
    content: '★';
    font-size: 0.9rem;
}

.profile-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    border-left: 3px solid var(--border-color);
    padding-left: 16px;
    font-style: italic;
}

/* Responsiveness */
@media (max-width: 900px) {
    .header-container {
        position: relative;
    }
    
    .search-bar {
        display: none; /* Hide on mobile initially for clean UI */
    }

    .main-nav {
        display: none; /* Hide standard nav on mobile */
    }

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

    .hero h1 {
        font-size: 2.8rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .filters {
        overflow-x: auto;
        padding-bottom: 8px;
        width: 100%;
        scrollbar-width: none;
    }
    
    .filters::-webkit-scrollbar {
        display: none;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-links {
        flex-direction: column;
        gap: 30px;
        justify-content: flex-start;
    }

    /* Mobile Carousel styles */
    .grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 20px;
        padding: 20px 5% 40px;
        margin: 0 -5%; /* Pull to edges */
        scrollbar-width: none; /* Hide scrollbar Firefox */
        -ms-overflow-style: none; /* Hide scrollbar IE/Edge */
    }

    .grid::-webkit-scrollbar {
        display: none; /* Hide scrollbar Chrome/Safari */
    }

    .calc-card {
        min-width: 85%;
        scroll-snap-align: center;
    }
}

@media (max-width: 600px) {
    .grid {
        grid-template-columns: 1fr;
    }
    .hero {
        padding: 50px 0 40px;
    }
    .hero h1 {
        font-size: 2.2rem;
    }

    .profile-container {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }

    .profile-container::before {
        width: 100%;
        height: 6px;
    }

    .profile-description {
        border-left: none;
        padding-left: 0;
        border-top: 2px solid var(--border-color);
        padding-top: 16px;
        margin-top: 16px;
    }

    .profile-credentials {
        justify-content: center;
    }

}

/* Ebook Section */
.ebook-section {
    padding: 80px 0;
    background-color: #0c121d;
    position: relative;
    overflow: hidden;
}

.ebook-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 60px;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.ebook-badge {
    display: inline-block;
    background: rgba(15, 82, 186, 0.2);
    color: #4175DF;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.ebook-content h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.ebook-content p {
    color: #94a3b8;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.ebook-subtitle {
    color: white !important;
    font-weight: 500;
    border-left: 3px solid var(--primary);
    padding-left: 15px;
    margin-top: 20px;
}

.btn-amazon-exclusive {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #FF9900 0%, #E47911 100%); /* Amazon colors */
    color: #000 !important;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(228, 121, 17, 0.3);
}

.btn-amazon-exclusive:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(228, 121, 17, 0.5);
    background: linear-gradient(135deg, #FFB84D 0%, #FF9900 100%);
}

.ebook-mockup {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mockup-icon {
    font-size: 12rem;
    color: rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
}

.glow-effect {
    position: absolute;
    width: 200px;
    height: 200px;
    background: var(--primary);
    filter: blur(80px);
    opacity: 0.4;
    border-radius: 50%;
}

@media (max-width: 900px) {
    .ebook-card {
        grid-template-columns: 1fr;
        padding: 40px 30px;
        text-align: center;
    }
    .ebook-content h2 {
        font-size: 2rem;
    }
    .btn-amazon-exclusive {
        width: 100%;
        justify-content: center;
    }
    .ebook-mockup {
        display: none;
    }
}
/* Global FAQ Section */
.faq-global-section {
    padding: 80px 0;
    background-color: var(--bg-main);
    border-top: 1px solid var(--border-color);
}

.faq-global-container {
    max-width: 900px;
    margin: 0 auto;
}

.faq-global-item {
    margin-bottom: 30px;
}

.faq-global-item h3 {
    font-size: 1.3rem;
    color: var(--text-main);
    margin-bottom: 12px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 10px;
}

.faq-global-item h3::before {
    content: 'Q:';
    color: var(--primary);
    font-weight: 800;
}

.faq-global-item p {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 1rem;
    border-left: 3px solid var(--border-color);
    padding-left: 20px;
}

.faq-global-item p a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}

.faq-global-item p a:hover {
    color: var(--primary-light);
}

@media (max-width: 768px) {
    .faq-global-section {
        padding: 50px 0;
    }
    
    .faq-global-item h3 {
        font-size: 1.15rem;
    }
}
