/* ===== CATEGORIES PAGE STYLES ===== */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --shadow-light: 0 5px 15px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 20px 40px rgba(0, 0, 0, 0.15);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.categories-page {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* ===== HERO SECTION ===== */

.categories-hero {
    position: relative;
    padding: 6rem 0 4rem;
    background: var(--primary-gradient);
    overflow: hidden;
    color: white;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.floating-shapes .shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #ff6b6b, #ee5a24);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, #4834d4, #686de0);
    top: 60%;
    right: 10%;
    animation-delay: 3s;
}

.shape-3 {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #00d2d3, #54a0ff);
    top: 30%;
    right: 30%;
    animation-delay: 6s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-30px) rotate(90deg); }
    50% { transform: translateY(-60px) rotate(180deg); }
    75% { transform: translateY(-30px) rotate(270deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(45deg, #ffffff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 3rem;
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* ===== CATEGORIES FILTERS ===== */

.categories-filters {
    padding: 2rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid #e2e8f0;
}

.filter-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 2rem;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-light);
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
    pointer-events: none;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
}

.suggestion-item:hover {
    background: #f8fafc;
    color: #667eea;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.filter-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
}

.filter-label {
    font-weight: 600;
    color: #475569;
    margin: 0;
    font-size: 0.95rem;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    font-size: 0.95rem;
    transition: var(--transition);
    min-width: 180px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filter-select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.filter-select:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.view-toggle {
    display: flex;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.view-btn {
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    position: relative;
}

.view-btn:hover {
    background: #f8fafc;
    color: #475569;
    transform: translateY(-1px);
}

.view-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.view-btn.active:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.results-indicator {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #667eea10, #764ba210);
    border: 1px solid #667eea20;
    border-radius: 8px;
    color: #475569;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    font-weight: 500;
}

/* ===== RESPONSIVE FILTER CONTROLS ===== */

@media (max-width: 768px) {
    .filter-card {
        padding: 1.5rem;
    }
    
    .filter-controls {
        justify-content: center;
        gap: 1rem;
        margin-top: 1.5rem;
    }
    
    .filter-group {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .filter-select {
        min-width: 160px;
        font-size: 0.9rem;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .search-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    .categories-filters {
        padding: 1.5rem 0;
    }
    
    .filter-card {
        padding: 1rem;
        margin: 0 1rem;
        border-radius: 8px;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .filter-group {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .filter-select {
        min-width: 140px;
        flex: 1;
    }
    
    .view-toggle {
        align-self: center;
        min-width: 120px;
    }
}

/* ===== CATEGORIES CONTENT ===== */

.categories-content {
    padding: 3rem 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #2d3748;
    display: flex;
    align-items: center;
}

/* ===== FEATURED CATEGORIES ===== */

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.featured-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
}

.featured-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-heavy);
}

.category-link {
    text-decoration: none;
    color: inherit;
}

.featured-card-inner {
    display: flex;
    align-items: center;
    padding: 2rem;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.featured-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    flex-shrink: 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.featured-content {
    flex: 1;
}

.featured-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.featured-desc {
    color: #64748b;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.featured-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
}

.article-count,
.last-updated {
    display: flex;
    align-items: center;
    color: #64748b;
    font-weight: 500;
}

.featured-arrow {
    color: #cbd5e0;
    font-size: 1.5rem;
    transition: var(--transition);
}

.featured-card:hover .featured-arrow {
    color: #667eea;
    transform: translateX(5px);
}

/* ===== ALL CATEGORIES GRID ===== */

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.category-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(15px);
    position: relative;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

.category-card-inner {
    padding: 2rem;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.category-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    transition: var(--transition);
}

.category-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

.category-content {
    flex: 1;
    margin-bottom: 1.5rem;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #2d3748;
    line-height: 1.3;
}

.category-description {
    color: #64748b;
    line-height: 1.5;
    font-size: 0.95rem;
}

.category-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.category-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stat {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: #64748b;
    gap: 0.25rem;
}

.explore-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: 8px;
    font-weight: 600;
    color: #475569;
    transition: var(--transition);
    font-size: 0.9rem;
}

.category-card:hover .explore-btn {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
}

.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    opacity: 0;
    transition: var(--transition);
}

.category-card:hover .category-overlay {
    opacity: 1;
}

/* ===== TECH PATHS SECTION ===== */

.tech-paths {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.path-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
}

.path-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: var(--transition);
}

.path-card.beginner::before {
    background: var(--success-gradient);
}

.path-card.intermediate::before {
    background: var(--warning-gradient);
}

.path-card.advanced::before {
    background: var(--secondary-gradient);
}

.path-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

.path-header {
    margin-bottom: 1.5rem;
}

.path-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: white;
}

.beginner .path-icon {
    background: var(--success-gradient);
}

.intermediate .path-icon {
    background: var(--warning-gradient);
}

.advanced .path-icon {
    background: var(--secondary-gradient);
}

.path-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

.path-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.path-tag {
    padding: 0.375rem 0.75rem;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.path-link {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--primary-gradient);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
}

.path-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    color: white;
}

/* ===== EMPTY STATE ===== */

.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    backdrop-filter: blur(15px);
}

.empty-icon {
    font-size: 5rem;
    color: #cbd5e0;
    margin-bottom: 2rem;
}

.empty-state h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1rem;
}

.empty-state p {
    color: #64748b;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-stats {
        gap: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .filter-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .featured-card-inner {
        flex-direction: column;
        text-align: center;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .tech-paths {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .categories-hero {
        padding: 4rem 0 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-card {
        padding: 1.5rem;
    }
    
    .featured-card-inner,
    .category-card-inner,
    .path-card {
        padding: 1.5rem;
    }
}

/* ===== ANIMATIONS ===== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-card,
.featured-card,
.path-card {
    animation: fadeInUp 0.6s ease-out;
}

.category-card:nth-child(1) { animation-delay: 0.1s; }
.category-card:nth-child(2) { animation-delay: 0.2s; }
.category-card:nth-child(3) { animation-delay: 0.3s; }
.category-card:nth-child(4) { animation-delay: 0.4s; }
.category-card:nth-child(5) { animation-delay: 0.5s; }
.category-card:nth-child(6) { animation-delay: 0.6s; } 

/* ===== LIST VIEW STYLES ===== */

.categories-grid.list-view {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
}

.categories-grid.list-view .category-card {
    width: 100% !important;
    max-width: none !important;
}

.categories-grid.list-view .category-card-inner {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    padding: 1.5rem !important;
    gap: 1.5rem !important;
}

.categories-grid.list-view .category-header {
    flex-shrink: 0 !important;
}

.categories-grid.list-view .category-content {
    flex: 1 !important;
    margin-bottom: 0 !important;
}

.categories-grid.list-view .category-footer {
    flex-shrink: 0 !important;
    align-self: flex-start !important;
    margin-top: 0 !important;
}

.categories-grid.list-view .category-title {
    font-size: 1.25rem !important;
    margin-bottom: 0.25rem !important;
}

.categories-grid.list-view .category-description {
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
}

.categories-grid.list-view .explore-btn {
    font-size: 0.875rem !important;
    padding: 0.5rem 1rem !important;
}

/* ===== GRID VIEW STYLES ===== */

.categories-grid.grid-view {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    gap: 2rem !important;
}

.categories-grid.grid-view .category-card-inner {
    flex-direction: column !important;
    text-align: center !important;
}

/* ===== ANIMATION IMPROVEMENTS ===== */

.fade-in {
    animation: fadeInUp 0.4s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-card,
.search-input,
.filter-select,
.view-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
} 

/* ===== SMOOTH TRANSITIONS AND INTERACTIONS ===== */

.categories-grid {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.categories-grid * {
    transition: inherit;
}

/* ===== IMPROVED BUTTON INTERACTIONS ===== */

.view-btn,
.filter-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.view-btn:active {
    transform: translateY(1px) scale(0.98);
}

.filter-select:active {
    transform: translateY(1px);
}

/* ===== LOADING AND INTERACTION STATES ===== */

.categories-grid.loading {
    opacity: 0.7;
    pointer-events: none;
}

.category-card.hiding {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.2s ease-out;
}

.category-card.showing {
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease-out;
}

/* ===== ENHANCED MOBILE RESPONSIVENESS ===== */

@media (max-width: 576px) {
    .categories-filters {
        padding: 1rem 0;
    }
    
    .filter-card {
        margin: 0 0.5rem;
        padding: 1rem;
    }
    
    .categories-grid.list-view .category-card-inner {
        flex-direction: column !important;
        text-align: center !important;
        gap: 1rem !important;
    }
    
    .categories-grid.list-view .category-header {
        align-self: center !important;
    }
    
    .categories-grid.list-view .category-content {
        text-align: center !important;
    }
    
    .categories-grid.list-view .category-footer {
        align-self: center !important;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */

.view-btn:focus,
.filter-select:focus,
.search-input:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.view-btn:focus:not(:focus-visible),
.filter-select:focus:not(:focus-visible),
.search-input:focus:not(:focus-visible) {
    outline: none;
}

/* ===== HIGH CONTRAST MODE SUPPORT ===== */

@media (prefers-contrast: high) {
    .filter-card {
        border: 2px solid #000;
    }
    
    .view-btn.active {
        background: #000;
        color: #fff;
    }
    
    .search-input:focus,
    .filter-select:focus {
        border-color: #000;
        box-shadow: 0 0 0 2px #000;
    }
}

/* ===== REDUCED MOTION SUPPORT ===== */

@media (prefers-reduced-motion: reduce) {
    .categories-grid,
    .category-card,
    .view-btn,
    .filter-select,
    .search-input {
        transition: none;
    }
    
    .fade-in {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* ===== PRINT STYLES ===== */

@media print {
    .categories-filters,
    .view-toggle {
        display: none;
    }
    
    .categories-grid {
        display: block !important;
    }
    
    .category-card {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
} 