/* ==========================================================================
   CarePDF - All Tools Page (Optimized & User-Friendly)
   ========================================================================== */

/* ==========================================================================
   1. Page Header
   ========================================================================== */

.page-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d1f3d 50%, #1a1a2e 100%);
    padding: 100px 0 48px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 25% 30%, rgba(239, 68, 68, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 70%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.page-header-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

/* Page Badge */
.page-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary-300);
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 100px;
    margin-bottom: 16px;
}

/* Page Title */
.page-header h1 {
    font-size: clamp(1.875rem, 4vw, 2.75rem);
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 12px;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.page-header h1 .text-highlight {
    background: linear-gradient(135deg, var(--primary-400) 0%, #f97316 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    font-size: 1.0625rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 28px;
    line-height: 1.5;
}

/* ==========================================================================
   2. Search Bar
   ========================================================================== */

.tools-search-bar {
    position: relative;
    max-width: 440px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 100px;
    padding: 4px 6px 4px 16px;
    transition: all 0.2s ease;
}

.tools-search-bar:focus-within {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.tools-search-bar .search-icon {
    color: rgba(255, 255, 255, 0.45);
    flex-shrink: 0;
}

.tools-search-bar input {
    flex: 1;
    padding: 12px;
    font-size: 0.9375rem;
    color: #ffffff;
    background: transparent;
    border: none;
    outline: none;
}

.tools-search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.clear-search {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.15s ease;
}

.clear-search:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

/* ==========================================================================
   3. Category Filter Pills
   ========================================================================== */

.category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.filter-btn.active {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
}

/* ==========================================================================
   4. Tools Listing Section
   ========================================================================== */

.tools-listing {
    padding: 48px 0 80px;
    background: #ffffff;
}

/* ==========================================================================
   5. Category Section
   ========================================================================== */

.tools-category-section {
    margin-bottom: 48px;
}

.tools-category-section:last-child {
    margin-bottom: 0;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.category-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.category-icon svg {
    width: 22px;
    height: 22px;
}

/* Category Icon Colors */
.cat-organize {
    background: linear-gradient(135deg, var(--primary-100) 0%, var(--primary-50) 100%);
    color: var(--primary);
}

.cat-optimize {
    background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
    color: #d97706;
}

.cat-convert-to {
    background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 100%);
    color: #059669;
}

.cat-convert-from {
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    color: #2563eb;
}

.cat-edit {
    background: linear-gradient(135deg, #ede9fe 0%, #f5f3ff 100%);
    color: #7c3aed;
}

.cat-security {
    background: linear-gradient(135deg, #fce7f3 0%, #fdf2f8 100%);
    color: #db2777;
}

.category-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

/* ==========================================================================
   6. Tools Grid
   ========================================================================== */

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

/* ==========================================================================
   7. Tool Card - iLovePDF Style (Same as Homepage)
   ========================================================================== */

.tool-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.tool-card:hover {
    border-color: var(--primary-200);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Tool Icon */
.tool-icon {
    width: 44px;
    height: 44px;
    background: var(--gray-50);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
    transition: all 0.2s ease;
}

.tool-card:hover .tool-icon {
    background: var(--primary);
    color: white;
}

.tool-icon svg {
    width: 22px;
    height: 22px;
    transition: color 0.2s ease;
}

/* Tool Content */
.tool-content {
    flex: 1;
    min-width: 0;
}

.tool-content h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 4px 0;
    transition: color 0.15s ease;
}

.tool-card:hover .tool-content h3 {
    color: var(--primary);
}

.tool-content p {
    font-size: 0.8125rem;
    color: var(--gray-500);
    line-height: 1.45;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tool Arrow */
.tool-arrow {
    color: var(--gray-300);
    font-size: 1.25rem;
    font-weight: 300;
    transition: all 0.15s ease;
    align-self: center;
    flex-shrink: 0;
}

.tool-card:hover .tool-arrow {
    color: var(--primary);
    transform: translateX(3px);
}

/* ==========================================================================
   8. No Results State
   ========================================================================== */

.no-results {
    text-align: center;
    padding: 64px 20px;
    grid-column: 1 / -1;
}

.no-results-icon {
    width: 80px;
    height: 80px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.no-results-icon svg {
    width: 36px;
    height: 36px;
    color: var(--gray-400);
}

.no-results h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.no-results p {
    font-size: 0.9375rem;
    color: var(--gray-500);
}

/* ==========================================================================
   9. Responsive - Tablet (1024px)
   ========================================================================== */

@media (max-width: 1024px) {
    .page-header {
        padding: 90px 0 40px;
    }
    
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

/* ==========================================================================
   10. Responsive - Small Tablet (768px)
   ========================================================================== */

@media (max-width: 768px) {
    .page-header {
        padding: 80px 0 36px;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .page-header p {
        font-size: 0.9375rem;
    }
    
    .tools-search-bar {
        max-width: 100%;
    }
    
    .category-filters {
        gap: 6px;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .tools-listing {
        padding: 36px 0 60px;
    }
    
    .tools-category-section {
        margin-bottom: 40px;
    }
    
    .category-header {
        margin-bottom: 20px;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ==========================================================================
   11. Responsive - Mobile (480px)
   ========================================================================== */

@media (max-width: 480px) {
    .page-header {
        padding: 76px 0 28px;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .page-badge {
        font-size: 0.75rem;
        padding: 5px 12px;
    }
    
    .tools-search-bar {
        padding: 2px 4px 2px 14px;
    }
    
    .tools-search-bar input {
        padding: 10px 8px;
        font-size: 0.875rem;
    }
    
    .filter-btn {
        padding: 5px 10px;
    }
    
    .tools-listing {
        padding: 28px 0 48px;
    }
    
    .category-icon {
        width: 38px;
        height: 38px;
    }
    
    .category-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .category-header h2 {
        font-size: 1.0625rem;
    }
    
    .tool-card {
        padding: 14px 16px;
    }
    
    .tool-icon {
        width: 40px;
        height: 40px;
    }
    
    .tool-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .tool-content h3 {
        font-size: 0.875rem;
    }
    
    .tool-content p {
        font-size: 0.75rem;
        -webkit-line-clamp: 1;
    }
}

/* ==========================================================================
   12. Dark Mode
   ========================================================================== */

[data-theme="dark"] .tools-listing {
    background: var(--gray-900);
}

[data-theme="dark"] .category-header {
    border-bottom-color: var(--gray-700);
}

[data-theme="dark"] .category-header h2 {
    color: #ffffff;
}

[data-theme="dark"] .tool-card {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

[data-theme="dark"] .tool-card:hover {
    border-color: var(--primary-600);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .tool-icon {
    background: var(--gray-700);
}

[data-theme="dark"] .tool-content h3 {
    color: #ffffff;
}

[data-theme="dark"] .tool-content p {
    color: var(--gray-400);
}

[data-theme="dark"] .tool-arrow {
    color: var(--gray-500);
}

[data-theme="dark"] .no-results-icon {
    background: var(--gray-800);
}

[data-theme="dark"] .no-results h3 {
    color: #ffffff;
}

/* ==========================================================================
   13. RTL Support
   ========================================================================== */

[dir="rtl"] .tool-card {
    flex-direction: row-reverse;
}

[dir="rtl"] .tool-arrow {
    transform: scaleX(-1);
}

[dir="rtl"] .tool-card:hover .tool-arrow {
    transform: scaleX(-1) translateX(3px);
}

/* ==========================================================================
   14. Print Styles
   ========================================================================== */

@media print {
    .page-header {
        background: none;
        color: #000;
        padding: 20px 0;
    }
    
    .page-header h1 {
        color: #000;
    }
    
    .tools-search-bar,
    .category-filters {
        display: none;
    }
    
    .tool-card {
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}
