/**
 * IMPORTANT: For editing rules and coding guidelines, see AI_documents/Rules/Rules_for_the_AI.txt
 * For project overview and details, see AI_documents/Project_Overview_Doc.txt
 *
 * Production Directory: http://ainspire.ai/css/whitepapers_library_page_mobile.css
 * Development Directory: http://localhost:8000/css/whitepapers_library_page_mobile.css
 *
 * Whitepapers Library Page - Mobile Styles (768px and below)
 */

/* ========================================
   Mobile Breakpoint: Tablets (768px)
   ======================================== */
@media (max-width: 768px) {


    .filters-container {    
        width: 80%;
        margin: 0 auto;
    }


    /* Library Main */
    .library-main { 
    }

    /* Hero Section */
    .library-hero {
        position: relative;
        padding: 10px 15px;
    }

    .library-hero-canvas { 
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
        pointer-events: none;
    }

    .library-hero-content {
        position: relative;
        z-index: 2;
    }

    .library-hero-content h1 {
        font-size: 2rem;
        margin-bottom: 15px;
    }

    .library-subtitle {
        font-size: 1rem;
        padding: 0 10px;
    }

    /* Filters Section */
    .library-filters {
        padding: 30px 15px;
    }

    /* Search Bar */
    .search-bar-wrapper {
        margin-bottom: 25px;
    }

    .search-input {
        padding: 16px 45px 16px 20px;
        font-size: 1rem;
    }

    .search-icon {
        right: 15px;
        font-size: 1.2rem;
    }

    /* Filter Controls - Stack vertically on mobile */
    .filter-controls {
        flex-direction: column;
        gap: 20px;
        width: 100%;
    }

    .filter-group {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .filter-group label {
        font-size: 0.95rem;
    }

    .filter-dropdown {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.95rem;
        min-width: unset;
    }

    .clear-filters-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 1rem;
    }

    /* Results Counter */
    .results-counter {
        font-size: 0.9rem;
        margin-top: 20px;
    }

    /* Library List */
    .library-list {
        padding: 40px 15px 80px;
    }

    .whitepapers-container {
        gap: 25px;
    }

    /* Whitepaper Card */
    .whitepaper-card {
        padding: 25px 20px;
        border-radius: 12px;
    }

    .whitepaper-card:hover {
        transform: none; /* Disable hover transform on mobile */
    }

    /* Card Header */
    .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        margin-bottom: 12px;
    }

    .card-title {
        font-size: 1.4rem;
        margin-bottom: 0;
    }

    .card-divider {
        margin-bottom: 15px;
    }

    .card-header-actions {
        justify-content: flex-start;
    }

    .read-whitepaper-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    /* Metadata Row - Stack on mobile */
    .card-metadata-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .card-metadata {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        font-size: 0.85rem;
    }

    .metadata-separator {
        display: none; /* Hide separators on mobile */
    }

    /* Category Badge */
    .card-category {
        width: 100%;
    }

    .category-badge {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    /* Tags Section (inline) */
    .card-tags {
        gap: 8px;
        margin-bottom: 0;
    }

    .tags-label {
        font-size: 0.95rem;
    }

    .tag-pill {
        padding: 5px 12px;
        font-size: 11px;
        font-weight: 500;
    }

    /* Summary Section */
    .summary-label {
        font-size: 0.95rem;
        display: block;
        margin-bottom: 4px;
    }

    .summary-text {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    /* No Results */
    .no-results {
        padding: 60px 20px;
    }

    .no-results p {
        font-size: 1.1rem;
        margin-bottom: 25px;
    }

    .no-results .clear-filters-btn {
        width: auto;
        min-width: 200px;
    }
}

/* ========================================
   Mobile Breakpoint: Small Mobile (480px)
   ======================================== */
@media (max-width: 480px) {

    /* Hero Section */
    .library-hero {
        padding: 30px 10px;
    }

    .library-hero-content h1 {
        font-size: 1.6rem;
    }

    .library-subtitle {
        font-size: 0.9rem;
    }

    /* Filters Section */
    .library-filters {
        padding: 25px 10px;
    }

    .search-input {
        padding: 14px 40px 14px 16px;
        font-size: 0.9rem;
        border-radius: 10px;
    }

    /* Filter Dropdown */
    .filter-dropdown {
        padding: 10px 12px;
        font-size: 0.9rem;
        border-radius: 6px;
    }

    .clear-filters-btn {
        padding: 12px 18px;
        font-size: 0.95rem;
        border-radius: 6px;
    }

    /* Results Counter */
    .results-counter {
        font-size: 0.85rem;
    }

    /* Library List */
    .library-list {
        padding: 30px 10px 60px;
    }

    .whitepapers-container {
        gap: 20px;
    }

    /* Whitepaper Card */
    .whitepaper-card {
        padding: 20px 15px;
        border-radius: 10px;
    }

    /* Card Header */
    .card-header {
        gap: 12px;
    }

    .card-title {
        font-size: 1.2rem;
        line-height: 1.4;
    }

    .read-whitepaper-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    /* Metadata Row */
    .card-metadata-row {
        gap: 12px;
    }

    .card-metadata {
        font-size: 0.8rem;
        gap: 8px;
    }

    .metadata-item .icon {
        font-size: 0.9rem;
    }

    /* Category Badge */
    .category-badge {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    /* Tags (inline) */
    .tags-label {
        font-size: 0.9rem;
    }

    .tag-pill {
        padding: 4px 10px;
        font-size: 10px;
        font-weight: 500;
    }

    /* Summary */
    .summary-label {
        font-size: 0.9rem;
    }

    .summary-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    /* No Results */
    .no-results {
        padding: 50px 15px;
    }

    .no-results p {
        font-size: 1rem;
    }
}

/* ========================================
   Touch-Friendly Enhancements
   ======================================== */
@media (hover: none) and (pointer: coarse) {

    /* Larger touch targets on mobile */
    .search-input,
    .filter-dropdown,
    .clear-filters-btn {
        min-height: 44px; /* iOS recommendation for touch targets */
    }

    .read-whitepaper-btn {
        min-height: 40px; /* Slightly smaller for header button */
    }

    .tag-pill {
        min-height: 32px;
        display: inline-flex;
        align-items: center;
    }

    /* Remove hover effects on touch devices */
    .whitepaper-card:hover {
        transform: none;
        box-shadow: none;
    }

    .tag-pill:hover {
        transform: none;
    }

    .read-whitepaper-btn:hover {
        transform: none;
    }

    .clear-filters-btn:hover {
        transform: none;
    }
}
