/* ==========================================================================
   Cogito Coach - Unified Stylesheet
   ========================================================================== */

/* ==========================================================================
   1. Base Reset & Typography
   ========================================================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf3 100%);
    min-height: 100vh;
    color: #1a202c;
    line-height: 1.6;
}

/* ==========================================================================
   2. CSS Variables (Brand Colors)
   ========================================================================== */

:root {
    --primary-start: #667eea;
    --primary-end: #764ba2;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-dark: #1a202c;
    --text-body: #4a5568;
    --text-muted: #718096;
    --text-light: #a0aec0;
    --bg-white: #ffffff;
    --bg-light: #f7fafc;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 20px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 40px rgba(102, 126, 234, 0.15);
    --shadow-primary: 0 4px 15px rgba(102, 126, 234, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
}

/* ==========================================================================
   3. Navigation
   ========================================================================== */

nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
    list-style: none;
}

.nav-links li {
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-body);
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-start);
    text-decoration: none;
}

.nav-cta {
    background: var(--primary-gradient);
    color: white !important;
    padding: 12px 28px;
    border-radius: 30px;
    box-shadow: var(--shadow-primary);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ==========================================================================
   4. Logo
   ========================================================================== */

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-dark);
}

.logo:hover {
    text-decoration: none;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: var(--shadow-primary);
}

.logo-name {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-slogan {
    font-size: 0.85rem;
    color: var(--primary-start);
    font-weight: 600;
}

/* ==========================================================================
   5. Buttons
   ========================================================================== */

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-start);
    border: 2px solid var(--primary-start);
    padding: 14px 30px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

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

/* ==========================================================================
   6. Container & Layout
   ========================================================================== */

.main-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

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

/* ==========================================================================
   7. Cards
   ========================================================================== */

.card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 48px;
}

.card-sm {
    padding: 32px;
}

/* ==========================================================================
   8. Section Headers
   ========================================================================== */

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.section-icon {
    font-size: 1.8rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* ==========================================================================
   9. Typography Helpers
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark);
}

p {
    color: var(--text-body);
    line-height: 1.7;
    margin-bottom: 12px;
}

ul {
    color: var(--text-body);
    line-height: 1.7;
    margin-bottom: 12px;
    padding-left: 20px;
}

li {
    margin-bottom: 6px;
}

a {
    color: var(--primary-start);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   10. Highlight Box
   ========================================================================== */

.highlight-box {
    background: linear-gradient(135deg, #f0e6ff 0%, #e6f0ff 100%);
    border-left: 4px solid var(--primary-start);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin: 16px 0;
}

.highlight-box p {
    margin-bottom: 0;
}

/* ==========================================================================
   11. Forms
   ========================================================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

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

/* ==========================================================================
   12. Footer
   ========================================================================== */

.footer {
    background: #1a202c;
    padding: 40px 20px;
}

.footer-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.footer-logo {
    margin-bottom: 20px;
}

.footer-logo span:first-child {
    font-size: 1.5rem;
}

.footer-logo span:last-child {
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    margin-left: 8px;
}

.footer-links {
    margin-bottom: 20px;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    margin: 0 15px;
}

.footer-links a:hover {
    color: white;
}

.footer-legal {
    margin-bottom: 20px;
}

.footer-legal a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 12px;
    font-size: 0.9rem;
}

.footer-legal a:hover {
    color: var(--text-light);
}

.footer-copyright {
    color: var(--text-body);
    font-size: 0.85rem;
}

/* Compact Footer (used on most pages) */
.footer-compact {
    background: #1a202c;
    padding: 24px 20px;
}

.footer-compact-inner {
    max-width: 900px;
    margin: 0 auto;
}

.footer-compact-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin-bottom: 16px;
}

.footer-compact-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: white;
    font-weight: 700;
}

.footer-compact-logo img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.footer-compact-divider {
    color: #4a5568;
}

.footer-compact-link {
    color: #a0aec0;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-compact-link:hover {
    color: white;
    text-decoration: none;
}

.footer-compact-legal-link {
    color: #718096;
    text-decoration: none;
    font-size: 0.85rem;
}

.footer-compact-legal-link:hover {
    color: #a0aec0;
    text-decoration: none;
}

.footer-compact-badges {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-compact-badge {
    text-decoration: none;
    background: #1a365d;
    color: #90cdf4;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.footer-compact-badge:hover {
    background: #2a4365;
    text-decoration: none;
}

.footer-compact-copyright {
    color: #4a5568;
    font-size: 0.8rem;
}

.footer-social-link {
    color: #4a5568;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    margin: 0 4px;
}

.footer-social-link:hover {
    color: #667eea;
}

.footer-social-link svg {
    vertical-align: middle;
}

/* ==========================================================================
   13. Modal
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 24px;
}

/* ==========================================================================
   14. Utility Classes
   ========================================================================== */

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.mb-4 {
    margin-bottom: 32px;
}

/* ==========================================================================
   15. Mobile Menu
   ========================================================================== */

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    color: var(--text-dark);
    z-index: 1001;
}

/* ==========================================================================
   16. Responsive
   ========================================================================== */

@media (max-width: 768px) {
    nav {
        padding: 12px 0;
    }

    .nav-container {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }

    .logo {
        flex: 1;
    }

    .logo-slogan {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        order: 2;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 8px 20px 20px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        gap: 0;
        z-index: 1000;
        border-radius: 0 0 12px 12px;
        order: 3;
    }

    .nav-links.show {
        display: flex;
    }

    .nav-links a {
        padding: 14px 0;
        border-bottom: 1px solid var(--border-color);
        display: block;
        width: 100%;
        font-size: 1rem;
        font-weight: 500;
        text-align: left;
        color: var(--text-dark);
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    .nav-links .nav-cta {
        margin-top: 16px;
        text-align: center;
        border-bottom: none;
        padding: 14px 24px;
        font-size: 1rem;
        border-radius: 30px;
    }

    .card {
        padding: 28px 20px;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .btn-primary {
        padding: 14px 28px;
        font-size: 1rem;
    }
}

/* ==========================================================================
   17. Blog
   ========================================================================== */

/* Blog Article (post page) */
.blog-article {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.blog-breadcrumbs {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.blog-breadcrumbs a {
    color: var(--text-muted);
}

.blog-breadcrumbs a:hover {
    color: var(--primary-start);
}

.blog-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.blog-category-parents { background: #fef3c7; color: #92400e; }
.blog-category-thinking { background: #e0e7ff; color: #3730a3; }
.blog-category-teachers { background: #d1fae5; color: #065f46; }
.blog-category-news { background: #fce7f3; color: #9d174d; }

.blog-post-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 16px 0;
    color: var(--text-dark);
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.blog-copy-link {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.blog-copy-link:hover {
    border-color: var(--primary-start);
    color: var(--primary-start);
}

.blog-hero {
    width: 100%;
    border-radius: var(--radius-md);
    margin-bottom: 32px;
}

.blog-hero img {
    width: 100%;
    border-radius: var(--radius-md);
    display: block;
}

/* Blog content typography */
.blog-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 40px 0 16px;
    color: var(--text-dark);
}

.blog-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 32px 0 12px;
    color: var(--text-dark);
}

.blog-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.blog-content blockquote {
    border-left: 4px solid var(--primary-start);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--bg-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.blog-content blockquote p {
    margin-bottom: 0;
    color: var(--text-body);
    font-style: italic;
}

.blog-content img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 24px auto;
    display: block;
}

.blog-content ul,
.blog-content ol {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 20px;
    padding-left: 24px;
}

/* Blog floating share sidebar */
.blog-share-float {
    position: fixed;
    left: max(16px, calc((100vw - 720px) / 2 - 70px));
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
}

.blog-share-float a,
.blog-share-float button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.blog-share-float a:hover,
.blog-share-float button:hover {
    background: var(--primary-start);
    color: #fff;
}

.blog-share-float .share-copied {
    background: #10b981;
    color: #fff;
}

@media (max-width: 1100px) {
    .blog-share-float {
        display: none;
    }
}

/* Blog author bio */
.blog-author {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

.blog-author-info strong {
    display: block;
    color: var(--text-dark);
    font-size: 1rem;
}

.blog-author-info span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Blog CTA sidebar */
.blog-cta {
    background: #f8fafc;
    border-left: 4px solid #667eea;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 24px 28px;
    margin: 40px 0 32px;
    text-align: left;
}

.blog-cta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 10px;
}

.blog-cta h3 {
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.blog-cta p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 16px;
    line-height: 1.6;
}

.blog-cta .btn-primary {
    display: inline-block;
    font-size: 0.9rem;
    padding: 10px 20px;
}

/* Blog email signup */
.blog-signup {
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    margin-bottom: 32px;
}

.blog-signup h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.blog-signup p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.blog-signup-form {
    display: flex;
    gap: 8px;
    max-width: 440px;
    margin: 0 auto;
}

.blog-signup-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
}

.blog-signup-form input:focus {
    outline: none;
    border-color: var(--primary-start);
}

.blog-signup-form button {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s;
}

.blog-signup-form button:hover {
    transform: translateY(-1px);
}

.blog-signup-status {
    font-size: 0.85rem;
    margin-top: 8px;
}

/* Blog listing page */
.blog-list {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.blog-list h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.blog-list > p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

/* Featured card (first post when < 5 posts) */
.blog-featured {
    display: block;
    text-decoration: none;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 32px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.blog-featured:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.blog-featured img {
    width: 100%;
    height: 320px;
    object-fit: cover;
}

.blog-featured-body {
    padding: 28px 32px;
}

.blog-featured-body h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 8px 0;
}

.blog-featured-body p {
    color: var(--text-body);
    margin-bottom: 12px;
}

.blog-featured-body .blog-read-link {
    color: var(--primary-start);
    font-weight: 600;
}

/* Blog card grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 24px;
}

.blog-card {
    display: block;
    text-decoration: none;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.blog-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.blog-card-body {
    padding: 20px;
}

.blog-card-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 8px 0;
    line-height: 1.4;
}

.blog-card-body p {
    color: var(--text-body);
    font-size: 0.9rem;
    margin-bottom: 12px;
    line-height: 1.6;
}

.blog-card-body .blog-read-link {
    color: var(--primary-start);
    font-weight: 600;
    font-size: 0.9rem;
}

.blog-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.blog-back {
    display: inline-block;
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.blog-back:hover {
    color: var(--primary-start);
}

/* Blog responsive */
@media (max-width: 768px) {
    .blog-post-title {
        font-size: 1.8rem;
    }

    .blog-article {
        padding: 24px 16px 60px;
    }

    .blog-cta {
        padding: 28px 20px;
    }

    .blog-signup-form {
        flex-direction: column;
    }

    .blog-featured img {
        height: 200px;
    }

    .blog-featured-body {
        padding: 20px;
    }

    .blog-featured-body h2 {
        font-size: 1.3rem;
    }

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

    .blog-list h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .logo-name {
        font-size: 1.3rem;
    }
}
