@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css');

/* ========================================================================== 
   CSS VARIABLES - GLOBAL DESIGN TOKENS
   Use these variables throughout the application for consistency
   Never hardcode these values - always reference the variable
   ========================================================================== */
   
:root {
    /* Primary Colors - Main brand colors */
    --primary-color: #3b82f6;    /* Used for links, buttons, and active elements */
    --primary-dark: #2563eb;     /* Darker shade of primary color for hover and active states */
    --primary-light: #60a5fa;    /* Lighter shade of primary color, used for backgrounds or highlighting */
    --secondary-color: #10b981;  /* Accent color, used for secondary actions or highlights */
    
    /* Text Colors - Typography */
    --text-dark: #1f2937;        /* Default text color for high readability */
    --text-medium: #6b7280;      /* Medium text color for secondary information */
    --text-light: #9ca3af;       /* Light text color for hints, disabled text, or secondary information */
    
    /* Background Colors */
    --bg-light: #f9fafb;         /* Light background color for pages and cards */
    --bg-white: #ffffff;         /* Pure white background, use sparingly for cards or sections */
    
    /* Border & Dividers */
    --border-color: #e5e7eb;     /* Default border color for dividers, input fields, and buttons */
    
    /* Shadows - Elevation system */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* Small shadow for subtle elevation */
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1); /* Medium shadow for moderate elevation */
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1); /* Large shadow for high elevation */
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1); /* Extra large shadow for topmost elevation */
}

/* ========================================================================== 
   GLOBAL RESET & BASE STYLES
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-white);
    width: 100%;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* ========================================================================== 
   HEADER & NAVIGATION STYLES
   Used on: ALL pages via MainLayout
   Components: MainLayout.razor, NavMenu.razor
   ========================================================================== */
   
.main-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.header-logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.header-logo a:hover {
    color: var(--primary-dark);
}

.header-logo i {
    font-size: 1.75rem;
}

.header-nav {
    display: flex;
    gap: 2rem;
    flex: 1;
    justify-content: center;
}

.header-nav .nav-link {
    color: var(--text-medium);
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
}

.header-nav .nav-link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.header-auth {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.header-auth .navbar-nav {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.header-auth .nav-item {
    display: flex;
    align-items: center;
}

.header-auth .nav-link {
    color: var(--text-medium);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.header-auth .nav-link:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.header-auth .btn-link {
    color: var(--text-medium);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.header-auth .btn-link:hover {
    color: var(--primary-color);
}

.header-auth form {
    margin: 0;
}

.header-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
    padding: 0.5rem;
    order: 3;
}

/* Main Content */
.main-content {
    flex: 1;
    width: 100%;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
}

/* ========================================================================== 
   HERO SECTIONS - UNIVERSAL STYLING
   Used on: Multiple pages (Books, Wizard, Quotes, About)
   Pattern: [page]-hero class (e.g., .books-hero, .wizard-hero)
   Note: Homepage hero is in home.css as .hero-section
   
   All heroes have:
   - Purple gradient background
   - White text
   - Left-aligned content
   - Consistent padding
   ========================================================================== */

.books-page,
.book-detail-page,
.wizard-page,
.quotes-page,
.about-page {
    min-height: 100vh;
    background: var(--bg-light);
}

/* All hero sections - consistent styling */
.books-hero,
.book-detail-hero,
.wizard-hero,
.quotes-hero,
.about-hero,
.my-books-hero,
.recommendations-hero,
.feed-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 0;
    text-align: left;
}

.books-hero h1,
.book-detail-hero h1,
.wizard-hero h1,
.quotes-hero h1,
.about-hero h1,
.my-books-hero h1,
.recommendations-hero h1,
.feed-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.books-hero .lead,
.book-detail-hero .lead,
.wizard-hero .lead,
.quotes-hero .lead,
.about-hero .lead,
.my-books-hero .lead,
.recommendations-hero .lead,
.feed-hero .lead {
    font-size: 1.25rem;
    opacity: 0.95;
    color: white;
    margin-bottom: 0;
}

/* Override any existing center-aligned heroes */
.quotes-hero,
.about-hero,
.my-books-hero,
.recommendations-hero,
.feed-hero {
    text-align: left;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .books-hero h1,
    .book-detail-hero h1,
    .wizard-hero h1,
    .quotes-hero h1,
    .about-hero h1,
    .my-books-hero h1,
    .recommendations-hero h1,
    .feed-hero h1 {
        font-size: 1.75rem;
    }

    .books-hero,
    .book-detail-hero,
    .wizard-hero,
    .quotes-hero,
    .about-hero,
    .my-books-hero,
    .recommendations-hero,
    .feed-hero {
        padding: 2rem 0;
    }
}

/* ========================================================================== 
   WIZARD PAGE STYLES
   Used on: /wizard page only
   Components: Pages/Wizard/Index.razor
   
   Structure:
   - wizard-page: Main container
   - wizard-hero: Header section
   - wizard-content: White card content
   - wizard-steps: Step indicator grid
   - wizard-text-step: Goals & CurrentSituation steps
   - wizard-questions-step: Questions step
   - wizard-books-step: Already read books step
   
   Standards:
   - padding-bottom: 4rem (consistent bottom spacing)
   - min-height: calc(100vh - 200px) (prevent footer overlap)
   ========================================================================== */

.wizard-page {
    min-height: 100vh;
    background: var(--bg-light);
}

.wizard-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 0;
}

.wizard-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.wizard-hero .lead {
    font-size: 1.25rem;
    opacity: 0.95;
}

.wizard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.wizard-content {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    margin-top: -2rem;
}

.wizard-intro {
    margin-bottom: 3rem;
}

.intro-card {
    background: var(--bg-light);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.intro-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.intro-icon i {
    font-size: 2.5rem;
    color: white;
}

.intro-card h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.intro-card ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.intro-card ul li {
    padding: 0.5rem 0;
    color: var(--text-medium);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.intro-card ul li i {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.wizard-start {
    text-align: center;
    margin: 3rem 0;
}

.btn-start-wizard {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1.25rem 3rem;
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-start-wizard:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.wizard-time {
    margin-top: 1rem;
    color: var(--text-medium);
    font-size: 0.9375rem;
}

.wizard-benefits {
    margin-top: 3rem;
}

.wizard-benefits h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.benefit-card {
    background: var(--bg-light);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s;
}

.benefit-card:hover {
    transform: translateY(-4px);
}

.benefit-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.benefit-card h4 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.benefit-card p {
    color: var(--text-medium);
    margin: 0;
    font-size: 0.875rem;
}

/* Wizard Steps Grid */
.wizard-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.step-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
}

.step-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step-card h4 {
    font-size: 1.125rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.step-card p {
    font-size: 0.875rem;
    color: var(--text-medium);
    margin: 0;
}

/* Already read books grid */
.already-read-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.already-read-book-card {
    cursor: pointer;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.2s;
    background: white;
}

.already-read-book-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.already-read-book-card.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.book-cover-container {
    position: relative;
    aspect-ratio: 2/3;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.selected-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(37, 99, 235, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.book-title-small {
    padding: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.2;
    max-height: 2.4rem;
    overflow: hidden;
}

.book-author-small {
    padding: 0 0.5rem 0.5rem;
    font-size: 0.6875rem;
    color: var(--text-medium);
    line-height: 1.2;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .wizard-hero h1 {
        font-size: 1.75rem;
    }

    .wizard-content {
        padding: 1.5rem;
        margin-top: -1rem;
    }

    .intro-card {
        padding: 1.5rem;
    }

    .btn-start-wizard {
        padding: 1rem 2rem;
        font-size: 1.125rem;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .already-read-books-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* Wizard Text Steps (Goals & CurrentSituation) */
.wizard-text-step {
    background: var(--bg-light);
    min-height: calc(100vh - 200px);
    padding-top: 3rem;
    padding-bottom: 4rem;
}

.wizard-text-step .card {
    box-shadow: var(--shadow-lg);
    border: none;
}

.wizard-text-step textarea.form-control {
    border: 2px solid var(--border-color);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-size: 1rem;
}

.wizard-text-step textarea.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
    outline: none;
}

/* Wizard Questions Step */
.wizard-questions-step {
    background: var(--bg-light);
    min-height: calc(100vh - 200px);
    padding-bottom: 4rem;
}

.wizard-questions-step .card {
    box-shadow: var(--shadow-lg);
    border: none;
}

.wizard-questions-step .list-group-item {
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.wizard-questions-step .list-group-item:hover {
    background: var(--bg-light);
    cursor: pointer;
}

.wizard-questions-step .list-group-item.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Wizard Already Read Books Step */
.wizard-books-step {
    background: var(--bg-light);
    min-height: calc(100vh - 200px);
    padding-bottom: 4rem;
}

.wizard-books-step h2,
.wizard-books-step h5 {
    color: var(--text-dark);
    font-weight: 600;
}

.wizard-books-step .lead {
    color: var(--text-medium);
}

.already-read-books-grid h5 {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 1rem;
}

/* ========================================================================== 
   FOOTER STYLES
   Used on: ALL pages via MainLayout
   Components: MainLayout.razor
   
   CRITICAL: Footer MUST be in site.css (not in component or page CSS)
   
   Structure:
   - main-footer: Dark background container
   - footer-container: Grid layout for footer sections
   - footer-section: Individual footer columns
   
   Typography:
   - H4/H5: White, 1.125rem, 600 weight
   - Links: Light gray, hover to white
   - Copyright: 0.875rem
   ========================================================================== */

.main-footer {
    background: var(--text-dark);
    color: var(--text-light);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section {
    line-height: 1.6;
}

.footer-section h4,
.footer-section h5 {
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section h4 i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.footer-section p {
    color: var(--text-light);
    margin-bottom: 0.75rem;
    line-height: 1.6;
    font-size: 0.9375rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section ul li a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s, padding-left 0.2s;
    display: inline-block;
    font-size: 0.9375rem;
}

.footer-section ul li a:hover {
    color: white;
    padding-left: 0.25rem;
}

.footer-info {
    margin-bottom: 0.75rem;
}

.footer-info a {
    color: var(--primary-light);
    text-decoration: none;
    font-size: 0.9375rem;
}

.footer-info a:hover {
    color: white;
    text-decoration: underline;
}

.footer-copyright {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-top: 1rem;
    margin-bottom: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .main-footer {
        padding: 2rem 0 1rem;
        margin-top: 2rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    .footer-section:first-child {
        text-align: center;
    }
    
    .footer-section h4,
    .footer-section h5 {
        justify-content: center;
    }
}

@media (max-width: 992px) {
    .header-nav-toggle {
        display: block;
    }

    .header-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 5rem 2rem 2rem;
        box-shadow: var(--shadow-xl);
        transition: left 0.3s ease;
        z-index: 999;
        gap: 0;
    }

    .header-nav.show {
        left: 0;
    }

    .header-nav .nav-link {
        width: 100%;
        padding: 1rem 0;
        border-bottom: 1px solid var(--border-color);
        border-radius: 0;
    }

    .header-nav .nav-link:hover {
        border-bottom-color: var(--border-color);
        padding-left: 0.5rem;
    }

    .header-container {
        padding: 1rem;
    }
}
