/* /css/homepage_style.css */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;700&display=swap');

/* Remove the :root block entirely */

body {
    font-family: "Poppins", sans-serif;
    margin: 0;
    color: #212529;
    
    /* --- NEW BACKGROUND STYLES --- */
    background-color: #fdfaf3; /* A warm, paper-like fallback color */
    background-image: url('../webimages/skybg.jpg'); /* Relative path from /css/ to /webimages/ */
    background-repeat: repeat; /* Tile the image to create a seamless texture */
    background-attachment: fixed; /* Keep the background stationary when scrolling */
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* --- Header --- */
.site-header {
    padding: 0.75rem 0;
    border-bottom: 1px solid #dee2e6;
}
.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.site-header .logo img {
    height: 72px;
}
.main-nav {
    display: flex;
    gap: 0.5rem;
}
.btn {
    padding: 0.5rem 1.2rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-primary {
    background-color: #28a745;
    color: white;
}
.btn-primary:hover {
    background-color: #218838;
}
.btn-secondary {
    background-color: transparent;
    color: #28a745;
    border: 1px solid #28a745;
}
.btn-secondary:hover {
    background-color: #28a745;
    color: white;
}

/* --- Add this to your Header section in homepage_style.css --- */

.main-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: var(--text-light, #6c757d);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.main-nav .nav-link:hover {
    color: var(--text-dark, #212529);
}

/* --- Hero Section --- */
.hero {
    position: relative; /* Required for the overlay */
    text-align: center;
    padding: 5rem 0; /* Increased padding for a more epic feel */
    color: white; /* Make all text inside the hero white */
    
    /* --- The Background Image --- */
    background-image: url('../webimages/hero-background.jpg'); /* Adjust path if needed */
    background-size: cover; /* Scale the image to cover the entire area */
    background-position: center; /* Center the image */
    background-repeat: no-repeat;
    z-index: 1; /* Establish a stacking context */
}

/* --- The Dark Overlay --- */
/* This pseudo-element sits between the background image and the text */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* A semi-transparent black overlay. Adjust opacity (0.5) as needed. */
    background-color: rgba(0, 0, 0, 0.5); 
    
    z-index: -1; /* Place it BEHIND the hero's content but IN FRONT of its background */
}

/* --- Adjust Text Colors for Readability --- */
.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5); /* Add a subtle shadow to text */
}

.hero .subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9); /* Slightly transparent white for the subtitle */
    max-width: 600px;
    margin: 0 auto 2rem auto;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.btn-large {
    font-size: 1.1rem;
    padding: 0.8rem 2rem;
    font-weight: 600;
}

/* REFINED: Style for the Search Bar on the Homepage */
.homepage-search {
    padding: 3rem 0 2rem 0; /* 3rem above, 2rem below */
    
    /* --- NEW BACKGROUND STYLES --- */
    background-color: #fff;
    /* The path needs to go up two levels from /login/css/ */
    background-image: url('../../webimages/skybg.jpg'); 
    background-repeat: repeat;
    background-attachment: center;
    
}

/* You can reuse the search form styles from search.php */
/* If you want it slightly different on the homepage, you can scope it like this: */
.homepage-search .search-form {
    max-width: 700px; /* Maybe a little wider on the homepage */
}

/* --- Featured Gallery --- */
.featured-gallery {
    padding: 2rem 0 4rem 0; /* 2rem above, 4rem below */
}
.featured-gallery h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
}
.flipbook-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.flipbook-card {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    
        /* --- NEW BACKGROUND STYLES --- */
    background-color: #fff;
    /* The path needs to go up two levels from /login/css/ */
    background-image: url('../webimages/woodbg3.jpg'); 
    background-repeat: repeat;
    background-attachment: contain;
    
}
.thumbnail-link {
    display: block;
    position: relative;
}
/* --- REVISED: Styles for "Floating" Thumbnail Effect --- */

/* 1. The Thumbnail Container */
.thumbnail {
    position: relative;
    
    /* Keep the square aspect ratio */
    aspect-ratio: 1 / 1; 

    /* Use flexbox to center the image inside */
    display: flex;
    justify-content: center;
    align-items: flex-start;

    /* Add padding to create a "frame" around the image */
    padding: 1rem; /* A little less padding than the admin cards */
    box-sizing: border-box;
    
    /* Remove overflow hidden to let the shadow be visible */
    overflow: visible;
    
    /* --- NEW BACKGROUND STYLES --- */
    background-color: var(--bg-light, #f8f9fa); /* Use the light background color variable */
    /* The path needs to go up two levels from /login/css/ */
    background-image: url('../webimages/woodbg2.jpg'); 
    background-repeat: repeat;
    background-attachment: contain;
    
}

/* 2. The Thumbnail Image */
.thumbnail img {
    /* Let the image size itself, but not exceed the container */
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    
    object-fit: contain;
    display: block;
    border-radius: 4px; /* Slightly rounded corners for the image */

    /* A subtle border to represent the cover's edge */
    border: 1px solid rgba(0, 0, 0, 0.2);

    /* --- THE SIDE-ON THICKNESS EFFECT --- */
    box-shadow: 
        /* The right and bottom page edges */
        4px 4px 0px rgba(0, 0, 0, 0.15),
        /* A soft drop shadow behind everything */
        6px 6px 12px rgba(0, 0, 0, 0.2);
    
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
/* 3. The Hover Effect (with enhanced thickness) */
.flipbook-card:hover .thumbnail img {
    transform: scale(1.05) translateY(-5px) rotate(1deg);
    
    box-shadow:
        /* Make the edges slightly larger on hover */
        6px 6px 0px rgba(0, 0, 0, 0.15),
        /* And the main drop shadow softer and larger */
        8px 8px 16px rgba(0, 0, 0, 0.25);
}
.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
}
.overlay-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}
.author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid white;
}
.card-content {
    padding: 1rem;
}
.card-content .title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-content .title a {
    color: inherit;
    text-decoration: none;
}
.card-content .title a:hover {
    color: #28a745;
}
.no-results {
    text-align: center;
    color: #6c757d;
    padding: 2rem;
}

/* --- NEW: Styles for Search Page --- */

.search-hero {
    text-align: center;
    padding: 3rem 0;

    /* --- NEW BACKGROUND STYLES --- */
    background-color: #f8f9fa;
    /* The path needs to go up two levels from /login/css/ */
    background-image: url('../../webimages/paperbg.jpg'); 
    background-repeat: repeat;
    background-attachment: fixed;
    
}

.search-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    /* The gap will now be created with margins */
}

.search-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    padding: 0.8rem 1rem;
    font-size: 1.1rem;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); /* <-- MOVED HERE */
    margin-right: 8px; /* <-- THE NEW GAP */
    transition: box-shadow 0.2s, border-color 0.2s; /* Added transition */
}
.search-input:focus {
    border-color: #28a745;
}

.search-form .btn {
    border-radius: 5px;
    /* border property can be removed if not needed for alignment */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); /* <-- ADDED HERE */
    transition: all 0.2s; /* Ensure hover transitions are smooth */
}

.search-results-gallery {
    padding: 3rem 0;
}

.search-results-gallery h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #6c757d !important;
}

/* REFINED & STRONGER: Style for the search results header */
.search-results-gallery h2.search-results-heading {
    text-align: center;
    font-size: 1.2rem !important; /* THE FIX: Added !important */
    font-weight: 300 !important;   /* Added !important for consistency */
    color: #6c757d !important;
    margin-top: 0 !important;
    margin-bottom: 1.8rem !important;
    border-bottom: 1px solid #eee !important;
    padding-bottom: 1.5rem !important;
}

.search-results-heading strong {
    font-weight: 600; /* Bolder weight for the search query */
    color: #212529;
}

/* =================================
   Free Tools Section Styles
==================================== */

.free-tools-section {
    padding: 60px 0; /* Adds vertical space above and below the section */
    text-align: center;
    
    /* --- NEW BACKGROUND STYLES --- */
    background-color: #f8f9fa;
    /* The path needs to go up two levels from /login/css/ */
    background-image: url('../../webimages/skybg.jpg'); 
    background-repeat: repeat;
    background-attachment: center;
    
}

.free-tools-section .section-title {
    margin-bottom: 40px; /* Space between the title and the cards */
    font-size: 2.5em; /* Make the title prominent */
    color: #343a40;
    font-weight: 600;
}

/* This creates the two-column layout */
.tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: 30px; /* The space between the two cards */
    max-width: 800px; /* Limit the width of the grid */
    margin: 0 auto; /* Center the grid within the section */
}

/* The style for each clickable tool card */
.tool-card {
    display: block; /* Makes the whole area of the <a> tag a block */
    background-color: #fffef8;
    padding: 40px 20px;
    border-radius: 45px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-decoration: none; /* Removes the default blue underline from the link */
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth transition for the hover effect */
}

.tool-card:hover {
    transform: translateY(-8px); /* Lifts the card up slightly on hover */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); /* Adds a more pronounced shadow on hover */
}

.tool-card img {
    height: 180px; /* Control the size of your icons */
    margin-bottom: 20px;
}

.tool-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
    color: #343a40;
}

.tool-card p {
    font-size: 0.75em;
    color: #6c757d; /* Lighter color for the description text */
    line-height: 1.5;
}

/* --- NEW: Styles for Pricing Page --- */

.pricing-hero {
    text-align: center;
    padding: 3rem 0;
    background-color: var(--bg-light, #f8f9fa);
    border-bottom: 1px solid #dee2e6;
}
.pricing-hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.pricing-table-section {
    padding: 4rem 0;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    align-items: stretch; /* Make cards the same height */
}

.pricing-card {
    display: flex;
    flex-direction: column; /* Allows footer to stick to the bottom */
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #fff;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.pricing-card.recommended {
    border-color: var(--primary-color, #28a745);
    border-width: 2px;
}

.recommended-badge {
    position: absolute;

    /* --- THE FIX IS HERE --- */
    top: 22px;   /* Push it down slightly */
    right: -30px; /* Pull it in from the right */
    
    background-color: var(--primary-color, #28a745);
    color: white;
    
    /* Give it a bit more width and padding */
    width: 140px;
    padding: 8px 0;
    text-align: center; /* Ensure text is centered */

    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    transform: rotate(45deg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Add a subtle shadow for depth */
}

.pricing-card .card-header {
    padding: 2rem;
    border-bottom: 1px solid #eee;
}
.card-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}
.price-tag {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark, #212529);
    margin: 0.5rem 0;
}
.price-tag span:first-child {
    font-size: 1.5rem;
    vertical-align: top;
    color: var(--text-light, #6c757d);
}
.price-tag span:last-child {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-light, #6c757d);
}
.card-description {
    color: var(--text-light, #6c757d);
    min-height: 40px; /* Ensures consistent height */
}

.pricing-card .card-body {
    padding: 2rem;
}
.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}
.features-list li {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.features-list li::before {
    font-weight: 900; /* For Font Awesome or similar */
    flex-shrink: 0;
    margin-top: 2px;
}
.features-list li.feature-included::before {
    content: '✓';
    color: var(--primary-color, #28a745);
}
.features-list li.feature-excluded::before {
    content: '✕';
    color: #dc3545;
}
.features-list li.feature-excluded {
    color: var(--text-light, #6c757d);
    text-decoration: line-through;
}

.pricing-card .card-footer {
    padding: 2rem;
    margin-top: auto; /* Pushes the footer to the bottom */
}
.card-footer .btn {
    width: 100%;
    padding: 0.8rem;
    font-size: 1.1rem;
}

/* --- NEW: THEMED STYLES FOR PRICING CARDS --- */

/* --- TIER 1: FREE (Green Theme) --- */
.pricing-card.tier-free {
    border-color: #d1fae5;
}
.pricing-card.tier-free .card-header {
    background-color: #f0fdf4;
}
.pricing-card.tier-free .price-tag {
    color: #065f46;
}
.pricing-card.tier-free .btn-secondary {
    border-color: #10b981;
    color: #10b981;
}
.pricing-card.tier-free .btn-secondary:hover {
    background-color: #10b981;
    color: white;
}

/* --- TIER 2: SUBSCRIBED (Orange Theme) --- */
.pricing-card.tier-subscribed {
    border-color: #f97316; /* Vibrant orange border for recommended */
}
.pricing-card.tier-subscribed .recommended-badge {
    background-color: #f97316;
}
.pricing-card.tier-subscribed .card-header {
    background-color: #fff7ed;
}
.pricing-card.tier-subscribed .price-tag {
    color: #9a3412;
}
.pricing-card.tier-subscribed .btn-primary {
    background-color: #f97316;
}
.pricing-card.tier-subscribed .btn-primary:hover {
    background-color: #ea580c;
}
.pricing-card.tier-subscribed .feature-included::before {
    color: #f97316; /* Make checkmarks orange */
}

/* --- TIER 3: CREATOR (Black/Gray Theme) --- */
.pricing-card.tier-creator {
    border-color: #d1d5db;
}
.pricing-card.tier-creator .recommended-badge {
    background-color: #4b5563; /* The same dark gray as the button */
}
.pricing-card.tier-creator .card-header {
    background-color: #f3f4f6; /* A light gray */
}
.pricing-card.tier-creator .price-tag {
    color: #1f2937; /* A deep, dark gray */
}
.pricing-card.tier-creator .btn-secondary {
    border-color: #4b5563;
    color: #4b5563;
}
.pricing-card.tier-creator .btn-secondary:hover {
    background-color: #4b5563;
    color: white;
}
.pricing-card.tier-creator .feature-included::before {
    color: #4b5563; /* Make checkmarks gray */
}


/* --- NEW: Styles for Logged-In User in Public Header --- */

.user-menu-public {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.welcome-block-public {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: right;
}

.welcome-block-public .profilename {
    font-weight: 600;
    color: var(--text-dark, #212529);
}

/* --- Styles for Subscription Status Badges (Copied from admin_style) --- */
/* It's good to have these in both stylesheets for consistency */
.status-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    font-weight: 600;
    font-size: 1rem;
    text-transform: capitalize;
}
.status-badge.header-badge { /* Smaller version for headers */
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.4;
}
.status-badge.free-status {
    background-color: #d1fae5;
    color: #065f46;
}
.status-badge.subscribed-status {
    background-color: #fff7ed;
    color: #9a3412;
}
.status-badge.creator-status {
    background-color: #e5e7eb;
    color: #1f2937;
}

.status-badge.nz360-status {
    background-color: #dbeafe; /* Pale Blue */
    color: #1e40af; /* Deep Blue Text */
    border: 1px solid #bfdbfe;
}

/* --- Responsive Design for Mobile --- */
/* This will stack the cards vertically on smaller screens */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr; /* One column on mobile */
    }
    .free-tools-section .section-title {
        font-size: 2em; /* Slightly smaller title on mobile */
    }
    .thumbnail {
        /* On mobile, align the image to the top to prevent cropping the title */
        align-items: flex-start;
        
        /* Optional: Reduce padding on mobile to give the image more space */
        padding: 0.9rem 3rem;
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.2rem; }
    .hero .subtitle { font-size: 1.1rem; }
    .featured-gallery h2 { font-size: 2rem; }

    .site-header .container { flex-direction: column; gap: 1rem; }
    .main-nav { justify-content: center; width: 100%; }
}

/* --- Site Footer Styles --- */
.site-footer {
    color: #fff;
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.85rem;
    margin-top: 3rem; 
    background-color: #368ec8;
}

.site-footer .footer-content {
    max-width: 1400px; /* Constrain width like .container */
    margin: 0 auto; /* Center the content */
    padding: 0 2rem; /* Add horizontal padding */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px; /* Increased gap for better spacing between sections */
}

.site-footer .footer-links {
    display: flex;
    flex-wrap: wrap; /* Allow links to wrap */
    justify-content: center;
    gap: 10px; /* Space between policy links */
}
.site-footer .footer-links a {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}
.site-footer .footer-links a:hover {
    color: #ff9c3f; 
}

/* NEW: Footer Social Links Container */
.footer-social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px; /* Space between social icons */
    margin-top: 10px; /* Space above social links */
    margin-bottom: 10px; /* Space below social links (before copyright) */
}

/* NEW: Individual Social Icon Link */
.social-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; /* Size of the icon area */
    height: 36px;
    border-radius: 50%; /* Circular background */
    background-color: rgba(255, 255, 255, 0.1); /* Subtle background for icons */
    transition: background-color 0.2s, transform 0.2s;
    color: #fff; /* Default icon color */
}

.social-icon-link:hover {
    background-color: rgba(255, 255, 255, 0.2); /* Brighter background on hover */
    transform: scale(1.1); /* MODIFIED: Make the icon slightly larger on hover */
    color: #fff; /* Ensure SVGs stay white on hover */
}

/* --- UNIFIED ICON STYLING FOR FOOTER --- */

/* This targets BOTH the SVG and the IMG tags inside the links */
.social-icon {
    width: 24px;  /* Set the desired icon size */
    height: 24px;
}

/* Specific rule for SVGs */
.social-icon:not(.social-icon-img) { /* This targets the SVG but not the IMG */
    fill: currentColor;
}

/* Specific rule for IMGs */
.social-icon-img {
    object-fit: contain; /* Ensures the image scales without distortion */
}

/* Responsive adjustment for footer */
@media (max-width: 768px) {
    .site-footer {
        padding: 1rem 0;
    }
    .site-footer .footer-content {
        padding: 0 1rem; /* Adjust horizontal padding on mobile */
    }
    .site-footer .footer-links {
        flex-direction: column; /* Stack policy links vertically on small screens */
        gap: 5px;
    }
    .site-footer .footer-links a {
        margin: 0;
    }
    .footer-social-links {
        gap: 15px; /* Reduce gap between social icons on mobile */
    }
    .social-icon-link {
        width: 32px; /* Smaller icons on mobile */
        height: 32px;
    }
    .social-icon {
        width: 20px; /* Smaller SVG icons on mobile */
        height: 20px;
    }
    .social-icon-img {
        object-fit: contain; /* Re-assert for safety */
    }
}

/* --- NEW: Styles for Pagination --- */

.pagination-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 2rem;
    padding: 1rem 0;
}

.pagination-nav a,
.pagination-nav span {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border: 1px solid #dee2e6;
    background-color: #fff;
    color: var(--primary-color, #28a745); /* Use your public theme color */
}

.pagination-nav a:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
}

.pagination-nav .current-page {
    background-color: var(--primary-color, #28a745);
    color: white;
    border-color: var(--primary-color, #28a745);
    cursor: default;
}

.pagination-nav .disabled {
    color: #6c757d;
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .pagination-nav a,
    .pagination-nav span {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

/* --- NEW: Styles for Call-to-Action Section --- */
.cta-section {
    background-color: var(--text-dark, #368ec8);
    color: white;
    text-align: center;
    padding: 4rem 0;
    margin-top: 2rem;
}
.cta-section h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}
.cta-section p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
}

/* ============================================= */
/* --- STYLES FOR HERO VIDEO BUTTON & LIGHTBOX --- */
/* ============================================= */

/* 1. Wrapper for the hero buttons */
.hero-buttons {
    display: flex;
    flex-wrap: wrap; /* Allow buttons to wrap on small screens */
    justify-content: center;
    align-items: center;
    gap: 1.5rem; /* Space between buttons */
    margin-top: 2rem;
}

/* 2. Style for the new "Watch Video" button (using its ID for specificity) */
#watch-video-btn {
    background-color: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
/* We also need to add the hover effect to the ID selector */
#watch-video-btn:hover {
    background-color: rgba(255, 255, 255, 0.15); /* Subtle hover effect */
}
/* And the SVG icon style */
#watch-video-btn svg {
    width: 1.5em;
    height: 1.5em;
}

/* 3. Styles for the Video Lightbox (inspired by viewer.php) */
.video-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.video-lightbox .video-container {
    width: 100%;
    max-width: 1100px;
    position: relative;
    /* Maintain 16:9 aspect ratio */
    aspect-ratio: 16 / 9;
}

.video-lightbox video {
    width: 100%;
    height: 100%;
    border-radius: 5px;
}

.video-lightbox .lightbox-close-btn {
    position: fixed; /* Position relative to the screen for consistency */
    top: 15px;
    right: 25px;
    font-size: 3rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    text-shadow: 0 0 5px black;
    z-index: 1001;
    transition: transform 0.2s ease;
}

.video-lightbox .lightbox-close-btn:hover {
    transform: scale(1.1);
}

/* ============================================= */
/* --- V4: PROFESSIONAL & ANIMATED STATS SECTION --- */
/* ============================================= */

.live-stats-section {
    padding: 3rem 0;
    background-color: #ffffff; /* Change to white for a cleaner card look */
    border-bottom: 1px solid #dee2e6;
    overflow-x: hidden; /* Prevent horizontal scrollbars from animation */
}

.stats-grid {
    display: grid;
    /* On mobile, start with 2 columns and let the last item center itself */
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Find the last item when there's an odd number (5) and make it span both columns */
.stats-grid .stat-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.stat-item {
    background-color: #f8f9fa; /* Light gray card background */
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    
    /* Animation setup */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease-out forwards;
}

/* Add a hover effect to the cards */
.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.07);
}

/* Stagger the animation for each card */
.stat-item:nth-child(1) { animation-delay: 0.1s; }
.stat-item:nth-child(2) { animation-delay: 0.2s; }
.stat-item:nth-child(3) { animation-delay: 0.3s; }
.stat-item:nth-child(4) { animation-delay: 0.4s; }

.stat-icon {
    margin: 0 auto 1rem auto;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

/* Thematic Color Accents */
.stat-item.public .stat-icon { background-color: #d1fae5; color: #065f46; } /* Now Green */
.stat-item.listed .stat-icon { background-color: #dbeafe; color: #1e40af; } /* Now Blue */
.stat-item.password .stat-icon { background-color: #fee2e2; color: #991b1b; } /* Red */
.stat-item.private .stat-icon { background-color: #e5e7eb; color: #1f2937; } /* Gray */
.stat-item.creator .stat-icon { background-color: #e5e7eb; color: #1f2937; } /* Gray */

.stat-number {
    display: block;
    font-size: 1.2rem !important;
    font-weight: 600;
    color: #212529;
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
    text-transform: none;
}

/* The animation keyframes */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments for desktop */
@media (min-width: 768px) {
    .stats-grid {
        /* On larger screens (tablets and up), switch to 5 columns */
        grid-template-columns: repeat(5, 1fr);
    }
    
    /* We no longer need the special rule for the last item on desktop */
    .stats-grid .stat-item:last-child:nth-child(odd) {
        grid-column: auto;
    }

    .stat-number {
        font-size: 2.1rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }
}

/* ============================================= */
/* --- STYLES FOR FEATURE COMPARISON TABLE     --- */
/* ============================================= */

.feature-comparison-section {
    padding: 4rem 0;
    background-color: #ffffff;
}

.feature-comparison-section .section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
}

.feature-table {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden; /* This is key for the rounded corners */
}

.feature-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr; /* 4 columns: Feature Name, Free, Subscribed, Creator */
    border-bottom: 1px solid #dee2e6;
    align-items: center;
}
.feature-row:last-child {
    border-bottom: none;
}

/* Style for the main header row */
.feature-row.header {
    background-color: #f8f9fa;
    font-weight: 600;
}
.feature-row.header .feature-tier {
    font-size: 1.2rem;
}

/* Style for section headers (e.g., "Core Features") */
.feature-row.section-header {
    grid-column: 1 / -1; /* Make this cell span all columns */
    background-color: #e9ecef;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    color: #495057;
    font-size: 1.1rem;
}

/* General cell styling */
.feature-name, .feature-tier {
    padding: 1rem 1.5rem;
}
.feature-name {
    text-align: left;
    font-weight: 500;
}
.feature-tier {
    text-align: center;
    font-size: 1.1rem;
}

/* --- START: NEW THEMATIC COLUMN COLORS --- */

/* This targets the 2nd child (Free column) in every row */
.feature-row .feature-tier:nth-child(2) {
    background-color: #f0fdf4; /* Pale Green */
}

/* This targets the 3rd child (Subscribed column) */
.feature-row .feature-tier:nth-child(3) {
    background-color: #fff7ed; /* Pale Orange */
}

/* This targets the 4th child (Creator column) */
.feature-row .feature-tier:nth-child(4) {
    background-color: #f1f5f9; /* Light Gray (Slate) */
}

/* 1. Remove the general background from the header row itself */
.feature-row.header {
    background-color: transparent;
    font-size: 1.2rem;
    font-weight: 700;
}

/* 2. Apply the dark thematic colors to each individual header cell */
.feature-row.header .feature-name {
    background-color: #999; /* Keep the first cell neutral */
    color: white;
    font-weight: 700;
}
.feature-row.header .feature-tier:nth-child(2) {
    background-color: #16a34a; /* Dark Green */
    color: white;
}
.feature-row.header .feature-tier:nth-child(3) {
    background-color: #f97316; /* Vibrant Orange */
    color: white;
}
.feature-row.header .feature-tier:nth-child(4) {
    background-color: #4b5563; /* Dark Gray */
    color: white;
}
.type-icon.creator { background-color: #e5e7eb; color: #1f2937; }
.type-icon.liked { background-color: #fce7f3; color: #9d174d; }

/* --- END: NEW THEMATIC COLUMN COLORS --- */

/* Checkmark and Exmark styling */
/* 1. Base style for ALL checkmarks (without a specific color) */
.feature-tier.checkmark {
    font-weight: 700;
    font-size: 1.5rem;
    /* The single color rule is removed from here */
}

/* 2. Thematic colors for checkmarks in each column */
/* Free Tier (2nd column) */
.feature-row .feature-tier:nth-child(2).checkmark {
    color: #198754; /* Green */
}

/* Subscribed Tier (3rd column) */
.feature-row .feature-tier:nth-child(3).checkmark {
    color: #f97316; /* Vibrant Orange */
}

/* Creator Tier (4th column) */
.feature-row .feature-tier:nth-child(4).checkmark {
    color: #4b5563; /* Dark Gray */
}

.feature-tier.exmark {
    color: #ced4da; /* Light Gray */
    font-weight: 400;
    font-size: 1.2rem;
}


/* --- RESPONSIVE STYLES FOR MOBILE --- */
@media (max-width: 768px) {
    .feature-comparison-section .section-title {
        font-size: 2rem;
    }

    /* This is the key for mobile: hide the main table header */
    .feature-row.header {
        display: none;
    }

    /* Convert the grid into a list-like view */
    .feature-row {
        grid-template-columns: 1fr; /* A single column */
        padding: 0;
    }
    
    .feature-name {
        background-color: #f8f9fa;
        font-weight: 700;
        padding: 0.75rem 1rem;
    }

    .feature-tier {
        display: flex;
        justify-content: space-between; /* Put label on left, value on right */
        padding: 0.75rem 1rem;
        text-align: right;
        border-bottom: 1px solid #f1f3f5; /* Lighter border between tiers on mobile */
    }
    .feature-tier:last-child {
        border-bottom: none;
    }

    /* Use the data-label attribute to create the label on mobile */
    .feature-tier::before {
        content: attr(data-label);
        font-weight: 500;
        text-align: left;
        color: #495057;
    }
}

/* ============================================= */
/* --- STYLES FOR PWA INSTALL PAGE           --- */
/* ============================================= */

.pwa-install-hero {
    padding: 3rem 0;
    text-align: center;
    background-color: #f8f9fa; /* Match stats section */
}

.pwa-app-icon {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.pwa-install-hero h1 {
    font-size: 2.5rem;
}

.pwa-instructions-section {
    padding: 3rem 0;
}

.install-wrapper, .instructions-wrapper {
    max-width: 600px;
    margin: 0 auto 2rem auto;
    text-align: center;
}

.install-wrapper .btn-large {
    width: auto;
    padding: 1rem 2.5rem;
}
.install-note {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

.instructions-wrapper h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

/* ============================================= */
/* --- V2: SIMPLIFIED PWA INSTRUCTION LIST --- */
/* ============================================= */

.steps-list {
    /* Use standard list styling for natural text flow */
    list-style: none; /* We will create our own custom numbers */
    padding-left: 0;
    margin-left: 1.5rem; /* Indent the whole list slightly */
    text-align: left;
    
    /* This creates the counter for our custom numbers */
    counter-reset: step-counter;
}

.steps-list li {
    font-size: 1.1rem;
    color: #333;
    line-height: 1.6; /* Add more space between lines for readability */
    margin-bottom: 1.2rem;
    position: relative; /* Needed for the custom number positioning */
    padding-left: 2.5rem; /* Create space for the custom number */
}

.steps-list li::before {
    content: counter(step-counter);
    counter-increment: step-counter;
    
    /* Style the number circle */
    position: absolute;
    left: 0;
    top: 0;
    background-color: #0d6efd;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    
    /* Use flexbox to center the number inside the circle */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* This is the same as before, just good to keep it */
.inline-icon {
    height: 24px;
    vertical-align: middle;
    margin: 0 4px; /* Add a little horizontal space around the icon */
}

/* ============================================= */
/* --- STYLES FOR PWA PROMO SECTION          --- */
/* ============================================= */

.pwa-promo-section {
    padding: 4rem 0;
    background-color: #f8f9fa; /* A light, neutral background */
}

.pwa-promo-content {
    display: flex;
    flex-direction: column; /* Stack on mobile */
    align-items: center;
    text-align: center;
    gap: 2rem;
}

.pwa-promo-icon img {
    width: 150px;
    height: 150px;
    border-radius: 28px; /* A nice "squircle" shape */
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.pwa-promo-text h2 {
    font-size: 2.2rem;
    margin-top: 0;
    margin-bottom: 1rem;
}

.pwa-promo-text p {
    font-size: 1.1rem;
    color: #495057;
    max-width: 600px; /* Constrain line length for readability */
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
}

/* Responsive adjustments for desktop */
@media (min-width: 768px) {
    .pwa-promo-content {
        flex-direction: row; /* Side-by-side on desktop */
        text-align: left;
    }
    .pwa-promo-text p {
        margin-left: 0;
        margin-right: 0;
    }
}

/* ======================================================= */
/* --- V3: RESPONSIVE FLIPBOOK TYPES SECTION --- */
/* ======================================================= */

.flipbook-types-section {
    padding: 4rem 1rem; /* Add horizontal padding for mobile */
    background-color: #ffffff;
}

.flipbook-types-section .section-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.flipbook-types-section .section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #6c757d;
    max-width: 700px;
    margin: 0 auto 3rem auto;
}

.types-visual-full {
    text-align: center;
    margin-bottom: 3rem;
}
.types-visual-full img {
    max-width: 100%;
    width: 800px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* --- THE RESPONSIVE FIX STARTS HERE --- */

/* Mobile First: Start with a single column layout */
.types-list-grid {
    display: grid;
    grid-template-columns: 1fr; /* Default to 1 column */
    gap: 1.5rem;
    max-width: 900px; /* Set a max-width for the grid itself */
    margin: 0 auto; /* Center the grid */
}

/* Tablet View: Switch to 2 columns */
@media (min-width: 600px) {
    .types-list-grid {
        grid-template-columns: 1fr 1fr; /* 2 columns */
    }
}

/* Desktop View: Switch to 3 columns for the 2x3 layout */
@media (min-width: 992px) {
    .types-list-grid {
        grid-template-columns: 1fr 1fr 1fr; /* 3 columns */
    }
}

/* --- (The rest of your styles for .type-item are perfect and don't need to change) --- */

.type-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    text-align: left; /* Ensure text is left-aligned */
}
.type-item:hover {
    transform: translateY(-5px);
    border-color: #ced4da;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.type-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.type-icon svg {
    width: 24px;
    height: 24px;
}

/* Thematic colors are still correct */
.type-icon.public { background-color: #d1fae5; color: #065f46; }
.type-icon.listed { background-color: #dbeafe; color: #1e40af; }
.type-icon.password { background-color: #fee2e2; color: #991b1b; }
.type-icon.private { background-color: #e5e7eb; color: #1f2937; }
.type-icon.creator { background-color: #e5e7eb; color: #1f2937; }
.type-icon.liked { background-color: #fce7f3; color: #9d174d; }

.type-text h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}
.type-text p {
    margin: 0;
    font-size: 0.95rem;
    color: #495057;
    line-height: 1.6;
}

/* Also adjust the main title on mobile */
@media (max-width: 768px) {
    .flipbook-types-section .section-title {
        font-size: 1.8rem;
    }
}