/* ============================================
   CATEGORY CARDS - Peşə Kartları
   XidmətTap.az
   ============================================ */

/* Category Grid Layout */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
}

/* Category Card */
.category-card {
    position: relative;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.25);
}

/* Category Image Container */
.category-image-container {
    position: relative;
    width: 100%;
    padding-top: 60%; /* 5:3 aspect ratio */
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.category-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.category-card:hover .category-image {
    transform: scale(1.1);
}

/* Category Overlay */
.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.5) 100%
    );
    display: flex;
    align-items: flex-end;
    padding: 20px;
    transition: background 0.3s ease;
}

.category-card:hover .category-overlay {
    background: linear-gradient(
        to bottom,
        rgba(102, 126, 234, 0.2) 0%,
        rgba(118, 75, 162, 0.7) 100%
    );
}

/* Category Icon Badge */
.category-icon-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.category-card:hover .category-icon-badge {
    transform: rotate(360deg) scale(1.1);
}

.category-icon-badge i {
    font-size: 28px;
}

/* Category Title on Image */
.category-title-overlay {
    color: white;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin: 0;
}

@media (max-width: 768px) {
    .category-title-overlay {
        font-size: 14px;
    }

    .category-icon-badge {
        width: 44px;
        height: 44px;
        top: 12px;
        right: 12px;
    }

    .category-icon-badge i {
        font-size: 20px;
    }
}

/* Category Info Section */
.category-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .category-info {
        padding: 12px;
    }
}

.category-name {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .category-name {
        font-size: 14px;
    }
}

.category-description {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

@media (max-width: 768px) {
    .category-description {
        font-size: 12px;
        display: none;
    }
}

/* Category Stats */
.category-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    margin-top: auto;
}

.category-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
}

.category-stat i {
    font-size: 16px;
    color: #667eea;
}

.category-stat strong {
    color: #1e293b;
    font-weight: 600;
}

@media (max-width: 768px) {
    .category-stats {
        gap: 8px;
    }

    .category-stat {
        font-size: 11px;
    }

    .category-stat i {
        font-size: 14px;
    }
}

/* Popular Badge */
.category-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    z-index: 1;
}

.category-badge i {
    font-size: 14px;
}

/* VIP Badge */
.category-badge.vip {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

/* New Badge */
.category-badge.new {
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/* Category Card Variants */
.category-card.featured {
    grid-column: span 2;
}

.category-card.featured .category-image-container {
    padding-top: 40%; /* Wider aspect ratio for featured */
}

@media (max-width: 768px) {
    .category-card.featured {
        grid-column: span 1;
    }
}

/* Category Card - Compact Style */
.category-card.compact {
    flex-direction: row;
    height: auto;
}

.category-card.compact .category-image-container {
    width: 120px;
    padding-top: 0;
    height: 100%;
    flex-shrink: 0;
}

.category-card.compact .category-image {
    position: static;
}

.category-card.compact .category-info {
    padding: 16px;
}

/* Category Card - List Style */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.category-card.list-style {
    flex-direction: row;
    height: auto;
}

.category-card.list-style .category-image-container {
    width: 160px;
    padding-top: 0;
    height: 140px;
    flex-shrink: 0;
}

.category-card.list-style .category-image {
    position: static;
}

@media (max-width: 768px) {
    .category-card.list-style .category-image-container {
        width: 100px;
        height: 100px;
    }
}

/* Shimmer Loading Effect */
.category-card.loading {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Category Section Header */
.category-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.category-section-title {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.category-section-subtitle {
    font-size: 16px;
    color: #64748b;
    margin-top: 8px;
}

.category-view-all {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.category-view-all:hover {
    color: #764ba2;
    gap: 10px;
}

.category-view-all i {
    transition: transform 0.3s ease;
}

.category-view-all:hover i {
    transform: translateX(4px);
}

/* Empty State */
.category-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.category-empty-state i {
    font-size: 64px;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.category-empty-state h3 {
    font-size: 20px;
    color: #475569;
    margin-bottom: 8px;
}

.category-empty-state p {
    font-size: 14px;
}

/* Filter Tabs */
.category-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.category-filters::-webkit-scrollbar {
    height: 4px;
}

.category-filters::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.category-filter-btn {
    background: white;
    border: 2px solid #e5e7eb;
    color: #64748b;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.category-filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.category-filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

/* Animation on Scroll */
.category-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.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; }
.category-card:nth-child(7) { animation-delay: 0.7s; }
.category-card:nth-child(8) { animation-delay: 0.8s; }

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .category-card {
        background: #1e293b;
    }

    .category-name {
        color: #f1f5f9;
    }

    .category-description {
        color: #94a3b8;
    }

    .category-stats {
        border-top-color: #334155;
    }

    .category-stat {
        color: #94a3b8;
    }

    .category-stat strong {
        color: #f1f5f9;
    }

    .category-section-title {
        color: #f1f5f9;
    }

    .category-section-subtitle {
        color: #94a3b8;
    }

    .category-filter-btn {
        background: #334155;
        border-color: #475569;
        color: #cbd5e1;
    }

    .category-icon-badge {
        background: rgba(30, 41, 59, 0.95);
    }
}
