/**
 * Category page styles - Modern Professional Design
 * Version: 3.2 - Professional Typography & Compact Layout
 * Styles for public-facing category pages
 */

/* Import professional font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* Categories Page - Modern Professional Design */
.categories-page {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 1.5rem var(--container-padding);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.02) 0%, rgba(147, 197, 253, 0.02) 100%);
    min-height: 100vh;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2.5rem 2rem;
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(255, 255, 255, 0.9) 100%);
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-navy), var(--accent-blue), var(--primary-navy));
    background-size: 200% 100%;
    animation: shimmer 6s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.page-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-navy), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.02em;
}

.page-description {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
}

.breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.9rem 1.5rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.breadcrumb a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: all 0.2s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.breadcrumb a:hover {
    color: var(--accent-blue);
    transform: translateY(-1px);
}

.breadcrumb .separator {
    color: var(--text-secondary);
    font-weight: 400;
    opacity: 0.9;
}

.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

/* Enhanced Categories Grid - Compact Gallery Layout */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modern Category Cards - Compact Professional Style */
.category-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.9) 100%);
    border-radius: 18px;
    padding: 1.75rem;
    border: 1px solid rgba(59, 130, 246, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.06),
        0 3px 12px rgba(59, 130, 246, 0.04);
    backdrop-filter: blur(15px);
    transform: translateY(0);
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--category-color, var(--primary-navy));
    transition: all 0.3s ease;
    box-shadow: 0 0 15px var(--category-color, var(--primary-navy));
}

.category-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30px, -30px);
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 
        0 16px 40px rgba(0, 0, 0, 0.12),
        0 8px 20px rgba(59, 130, 246, 0.1);
    border-color: var(--category-color, var(--primary-navy));
}

.category-card:hover::before {
    height: 5px;
    box-shadow: 0 0 20px var(--category-color, var(--primary-navy));
}

.category-card:hover::after {
    transform: translate(25px, -25px) scale(1.1);
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
}

/* Category Header - Compact Layout */
.category-header {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    position: relative;
    z-index: 2;
}

.category-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex: 1;
    line-height: 1.2;
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: -0.01em;
}

.category-icon {
    font-size: 1.75rem;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--category-color, var(--primary-navy)), rgba(59, 130, 246, 0.8));
    border-radius: 12px;
    color: white;
    box-shadow: 
        0 6px 20px rgba(59, 130, 246, 0.25),
        0 3px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.category-card:hover .category-icon {
    transform: scale(1.05);
    box-shadow: 
        0 8px 25px rgba(59, 130, 246, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-name a {
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    line-height: 1.3;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.category-name a:hover {
    color: var(--category-color, var(--primary-navy));
    transform: translateX(4px);
}

/* Category Footer - Compact with Post Count */
.category-footer {
    margin-top: 0.5rem;
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Simple Post Count Text */
.post-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: auto;
    opacity: 0.8;
}

/* Category Description - Compact */
.category-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    position: relative;
    z-index: 2;
    font-weight: 400;
}

/* Category Footer - Compact */
.category-footer {
    margin-top: 0.5rem;
    position: relative;
    z-index: 2;
}

.category-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--category-color, var(--primary-navy)), rgba(59, 130, 246, 0.8));
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.category-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.category-link:hover::before {
    left: 100%;
}

.category-link:hover {
    background: linear-gradient(135deg, var(--category-color, var(--primary-navy)), rgba(59, 130, 246, 0.9));
    color: white;
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.2),
        0 4px 12px rgba(59, 130, 246, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.category-link::after {
    content: '→';
    font-size: 1rem;
    font-weight: 600;
    transition: transform 0.3s ease;
}

.category-link:hover::after {
    transform: translateX(4px);
}

/* Categories Summary - Compact */
.categories-summary {
    text-align: center;
    padding: 2.5rem 2rem;
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-radius: 18px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    color: var(--text-secondary);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 4px 16px rgba(59, 130, 246, 0.06);
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
}

.categories-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-navy), var(--accent-blue));
}

.categories-summary p {
    font-size: 1.2rem;
    line-height: 1.6;
    margin: 0;
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-variant-numeric: tabular-nums; /* Professional, aligned numerals */
}

.categories-summary strong {
    color: var(--text-primary); /* High contrast for readability */
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35); /* Improve legibility on dark gradient */
}

/* Empty State - Compact */
.empty-state {
    text-align: center;
    padding: 6rem 2.5rem;
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-radius: 18px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 4px 16px rgba(59, 130, 246, 0.06);
    backdrop-filter: blur(15px);
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 2rem;
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 2.25rem;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    font-weight: 800;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Enhanced Buttons - Compact */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.75rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-navy), var(--accent-blue));
    color: white;
    box-shadow: 
        0 4px 15px rgba(59, 130, 246, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-blue), var(--primary-navy));
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(59, 130, 246, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--card-bg), rgba(255, 255, 255, 0.95));
    color: var(--text-primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(59, 130, 246, 0.06);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 197, 253, 0.1));
    border-color: var(--primary-navy);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(59, 130, 246, 0.15),
        0 3px 10px rgba(0, 0, 0, 0.1);
}

/* Category Card Color Variations */
.category-card[style*="--category-color: #2d5016"] { --category-color: #2d5016; }
.category-card[style*="--category-color: #1e40af"] { --category-color: #1e40af; }
.category-card[style*="--category-color: #dc2626"] { --category-color: #dc2626; }
.category-card[style*="--category-color: #059669"] { --category-color: #059669; }
.category-card[style*="--category-color: #7c3aed"] { --category-color: #7c3aed; }
.category-card[style*="--category-color: #ea580c"] { --category-color: #ea580c; }
.category-card[style*="--category-color: #0891b2"] { --category-color: #0891b2; }
.category-card[style*="--category-color: #be185d"] { --category-color: #be185d; }
.category-card[style*="--category-color: #16a34a"] { --category-color: #16a34a; }
.category-card[style*="--category-color: #9333ea"] { --category-color: #9333ea; }
.category-card[style*="--category-color: #ca8a04"] { --category-color: #ca8a04; }
.category-card[style*="--category-color: #0d9488"] { --category-color: #0d9488; }
.category-card[style*="--category-color: #e11d48"] { --category-color: #e11d48; }
.category-card[style*="--category-color: #7f1d1d"] { --category-color: #7f1d1d; }

/* Enhanced Hover Effects - Subtle */
.category-card:hover .category-icon {
    animation: iconSubtle 0.6s ease-in-out;
}

@keyframes iconSubtle {
    0%, 100% { transform: scale(1.05); }
    50% { transform: scale(1.1); }
}

/* Smooth Loading Animation - Reduced */
.categories-grid {
    animation: fadeInUp 0.8s ease-out;
}

/* Staggered Animation for Cards - Reduced */
.category-card:nth-child(1) { animation-delay: 0.05s; }
.category-card:nth-child(2) { animation-delay: 0.1s; }
.category-card:nth-child(3) { animation-delay: 0.15s; }
.category-card:nth-child(4) { animation-delay: 0.2s; }
.category-card:nth-child(5) { animation-delay: 0.25s; }
.category-card:nth-child(6) { animation-delay: 0.3s; }

/* Enhanced Focus States for Accessibility */
.category-card:focus-within {
    outline: 2px solid var(--category-color, var(--primary-navy));
    outline-offset: 2px;
}

.category-link:focus {
    outline: 2px solid var(--category-color, var(--primary-navy));
    outline-offset: 2px;
}

/* Dark Theme Enhancements - Reduced Reflectiveness */
@media (prefers-color-scheme: dark) {
    .category-card {
        background: linear-gradient(145deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.9) 100%);
        border-color: rgba(59, 130, 246, 0.15);
    }
    
    .category-card:hover {
        background: linear-gradient(145deg, rgba(30, 41, 59, 0.98) 0%, rgba(51, 65, 85, 0.95) 100%);
        border-color: var(--category-color, var(--primary-navy));
    }
    
    .page-header {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.9) 100%);
    }
    
    .categories-summary {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.9) 100%);
    }
}

/* Print Styles */
@media print {
    .category-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .category-card:hover {
        transform: none;
    }
    
    .page-header::before,
    .category-card::before,
    .category-card::after {
        display: none;
    }
}

/* Responsive Design - Compact */
@media (max-width: 768px) {
    .categories-page {
        padding: 1rem;
    }
    
    .page-header {
        padding: 2rem 1rem;
        margin-bottom: 2.5rem;
    }
    
    .page-title {
        font-size: 2.5rem;
    }
    
    .page-description {
        font-size: 1.1rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .category-card {
        padding: 1.5rem;
    }
    
    .category-header {
        flex-direction: column;
        gap: 1.25rem;
        align-items: flex-start;
    }
    
    .category-count {
        align-self: flex-end;
    }
    
    .breadcrumb {
        padding: 0.75rem 1.5rem;
        font-size: 0.85rem;
    }
    
    .categories-summary {
        padding: 2rem 1.5rem;
    }
    
    .empty-state {
        padding: 5rem 2rem;
    }
    
    .empty-icon {
        font-size: 4.5rem;
    }
    
    .empty-state h3 {
        font-size: 2rem;
    }
    
    .btn {
        padding: 0.875rem 1.75rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 2rem;
    }
    
    .page-description {
        font-size: 1rem;
    }
    
    .category-card {
        padding: 1.25rem;
    }
    
    .category-name {
        font-size: 1.4rem;
    }
    
    .category-icon {
        width: 45px;
        height: 45px;
        font-size: 1.75rem;
    }
    
    .count-number {
        font-size: 1.6rem;
    }
    
    .category-link {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}