@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;700;900&display=swap');

:root {
    /* Primary Brand Colors */
    --primary-orange: #E65C00;
    /* Campfire Orange */
    --primary-blue: #1A1A2E;
    /* Deep Indigo */
    --primary-green: #006633;

    /* Backgrounds */
    --bg-main: #FAF7F2;
    /* Warm White */
    --bg-warm-white: #FAF7F2;
    --bg-card: #FFFFFF;

    /* Text */
    --text-main: #1A1A2E;
    --text-muted: #555555;
    --text-light: #F5F5F5;

    /* Glassmorphism Tokens */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-blur: 15px;

    /* Utility */
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.12);
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;

    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Feature Colors (Direct Access) */
    --color-white: #FFFFFF;
    --color-black: #000000;
}

@view-transition {
    navigation: auto;
}

/* Default Theme (Light) */
:root,
[data-theme="light"] {
    --bg-main: #FAF7F2;
    --bg-warm-white: #FAF7F2;
    --bg-card: #FFFFFF;
    --text-main: #1A1A2E;
    --text-heading: #1A1A2E;
    /* Primary Blue */
    --text-muted: #555555;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --bg-main: #0F0F1A;
    --bg-card: #1A1A2E;
    --text-main: #F5F5F5;
    --text-heading: #F5F5F5;
    /* White for headings in dark mode */
    --text-muted: #A0A0A0;
    --glass-bg: rgba(26, 26, 46, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Playfair Display', serif;
    color: var(--text-heading);
    margin-bottom: 0.5em;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition-smooth);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--primary-orange);
}

.logo-text-wrapper {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-orange);
}

.logo-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    font-weight: 600;
    color: var(--text-dark);
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-orange);
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.8rem;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background-color: var(--primary-orange);
    color: white;
}

.btn-secondary {
    background-color: var(--primary-blue);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(230, 92, 0, 0.2);
}

/* Theme Toggle */
.theme-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--primary-orange);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 1.1rem;
    margin-left: 1rem;
}

.theme-toggle:hover {
    background: var(--primary-orange);
    color: white;
    transform: scale(1.1) rotate(15deg);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--bg-warm-white) 0%, #f0e6d2 100%);
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-green) 33%, var(--primary-blue) 33%, var(--primary-blue) 66%, var(--primary-orange) 66%);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero Customizations */
.hero-bento-adjust {
    padding: 2rem 0;
    grid-auto-rows: 250px;
}

.hero-contents {
    display: contents;
}

.hero-large-card {
    background: linear-gradient(rgba(26, 26, 46, 0.3), var(--primary-blue)), url('https://images.unsplash.com/photo-1543002588-bfa74002ed7e?auto=format&fit=crop&q=80&w=1000') center/cover;
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2.5rem;
}

.hero-large-card h1 {
    color: var(--color-white);
    font-size: 3.5rem;
    margin-top: 0.5rem;
    line-height: 1.1;
}

.hero-large-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    margin: 1rem 0 2rem;
    max-width: 500px;
}

.hero-tag-orange {
    background: var(--primary-orange);
    color: var(--color-white);
}

.hero-blue-card {
    background: var(--primary-blue);
    color: var(--color-white);
}

.hero-blue-card p {
    color: rgba(255, 255, 255, 0.7);
}

.flex-center-gap {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.app-icon-no-margin {
    background: var(--primary-orange);
    margin-bottom: 0;
}

.app-icon-inner {
    color: var(--color-white);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.link-highlight {
    color: var(--primary-orange);
    font-weight: 600;
    font-size: 0.9rem;
}

.placeholder-group {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
}

.placeholder-square {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
}

/* Sections */
.section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    display: block;
    font-size: 2.5rem;
    color: var(--primary-blue);
}

.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background-color: var(--primary-orange);
    margin: 15px auto 0;
    border-radius: 2px;
}

/* Grids */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Bento Grid System */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 180px;
    gap: 1.5rem;
}

.bento-item {
    border-radius: var(--border-radius-lg);
}

.bento-wide {
    grid-column: span 2;
}

.bento-tall {
    grid-row: span 2;
}

.bento-large {
    grid-column: span 2;
    grid-row: span 2;
}

/* Category Island Styles */
.island-container {
    margin-top: -1.5rem;
    position: relative;
    z-index: 10;
}

.island-wrapper {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.island-link {
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
}

.island-icon-orange {
    color: var(--primary-orange);
}

.island-icon-blue {
    color: var(--primary-blue);
}

.island-icon-green {
    color: var(--primary-green);
}

.font-weight-600 {
    font-weight: 600;
}

@media (max-width: 992px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .bento-wide,
    .bento-tall,
    .bento-large {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
}

/* Glass Variant */
.card-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.app-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--border-radius-md);
    background-color: #eee;
    margin-bottom: 1.2rem;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.category-tag {
    font-size: 0.8rem;
    color: var(--primary-green);
    background-color: rgba(0, 102, 51, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

/* Ad Banner */
.ad-banner {
    background-color: white;
    border: 2px dashed #ddd;
    padding: 2rem;
    text-align: center;
    margin: 2rem 0;
    border-radius: var(--border-radius);
}

.home-ad-custom {
    margin: 3rem 0;
    text-align: center;
    border: 1px dashed var(--primary-orange);
}

.ad-label {
    color: var(--primary-orange);
    font-size: 0.7rem;
    letter-spacing: 2px;
    font-weight: 700;
}

.ad-title-custom {
    margin: 0.5rem 0;
}

/* Category Section Styles */
.digital-library-bg {
    background-color: #f4f4f4;
    /* Light gray for contrast */
    padding: 4rem 20px;
    border-radius: 8px;
}

[data-theme="dark"] .digital-library-bg {
    background-color: var(--bg-card);
}

.icon-margin-bottom {
    margin-bottom: 1rem;
}

/* Utility Classes */
.mt-2 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.p-0 {
    padding: 0;
}

.text-center {
    text-align: center;
}

.w-100 {
    width: 100%;
}

.ad-content span {
    display: block;
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    background-color: var(--primary-blue);
    color: white;
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-col h4 {
    color: var(--primary-orange);
    margin-bottom: 1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: #ddd;
}

.footer-col a:hover {
    color: white;
}

/* Responsive */
/* Responsive Navigation */
.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--primary-blue);
    margin: 5px;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .nav-links {
        position: absolute;
        right: 0px;
        height: 92vh;
        top: 8vh;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 60%;
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
        z-index: 99;
        padding-top: 2rem;
    }

    @media (prefers-color-scheme: dark) {
        .nav-links {
            background-color: rgba(26, 26, 46, 0.98);
        }
    }

    .nav-links li {
        opacity: 0;
    }

    .burger {
        display: block;
    }
}

.nav-active {
    transform: translateX(0%);
}

@keyframes navLinkFade {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toggle .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.toggle .line2 {
    opacity: 0;
}

.toggle .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* ================================
   Phase 3D: Social Login & Push Notifications
   ================================ */

/* Social Login Divider */
.social-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0;
    color: #666;
}

.social-divider::before,
.social-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.social-divider span {
    padding: 0 15px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Social Login Buttons */
.social-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.btn-social:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-social:active {
    transform: translateY(0);
}

.btn-google {
    border-color: #4285F4;
    color: #333;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #4285F4;
}

.btn-facebook {
    background: #1877F2;
    border-color: #1877F2;
    color: white;
}

.btn-facebook:hover {
    background: #166fe5;
    border-color: #166fe5;
}

.social-icon {
    flex-shrink: 0;
}

/* Push Notification Styles */
.push-notification-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    padding: 15px 25px;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: slideInRight 0.3s ease;
}

.push-notification-message.success {
    background: #4CAF50;
}

.push-notification-message.error {
    background: #f44336;
}

.push-notification-message.warning {
    background: #ff9800;
}

.push-notification-message.info {
    background: #2196F3;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Settings Section */
.settings-section {
    margin-top: 30px;
}

.settings-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.settings-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
}

.settings-card h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #555;
    font-size: 1em;
}

/* Push Status Badge */
.push-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    background: #e0e0e0;
    color: #666;
}

.status-badge.active {
    background: #4CAF50;
    color: white;
}

/* Notification Preferences Form */
.preferences-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.preference-item {
    margin-bottom: 12px;
}

.preference-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95em;
    color: #333;
}

.preference-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #4CAF50;
}

/* Linked Social Accounts */
.linked-account {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #fafafa;
}

.linked-account:hover {
    background: #f5f5f5;
}

.account-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

/* Button Variants */
.btn-sm {
    padding: 6px 14px;
    font-size: 0.85em;
}

.btn-danger {
    background: #f44336;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Social Auth Error Alert */
.social-auth-error,
.social-auth-success {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    animation: fadeInDown 0.3s ease;
}

.social-auth-error {
    background: #f44336;
}

.social-auth-success {
    background: #4CAF50;
}

@keyframes fadeInDown {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Responsive adjustments for social buttons */
@media (min-width: 768px) {
    .social-login-buttons {
        flex-direction: row;
    }

    .btn-social {
        flex: 1;
    }
}

/* Dark mode support (if applicable) */
@media (prefers-color-scheme: dark) {
    .settings-card {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    .settings-card h3,
    .settings-card h4 {
        color: #e0e0e0;
    }

    .linked-account {
        background: #333;
        border-color: #444;
    }

    .linked-account:hover {
        background: #3a3a3a;
    }

    .btn-social {
        background: #333;
        border-color: #444;
        color: #e0e0e0;
    }

    .btn-google:hover {
        background: #3a3a3a;
    }

    .preference-item label {
        color: #e0e0e0;
    }

    .social-divider {
        color: #999;
    }

    .social-divider::before,
    .social-divider::after {
        background: #444;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}