/**
 * Category Cards Styles
 * تصاميم بطاقات التصنيفات الاحترافية
 * 
 * Features:
 * - Modern gradient backgrounds
 * - Smooth hover animations
 * - Icon animations
 * - Responsive grid layout
 * - Beautiful shadows
 * - Professional transitions
 * 
 * @version 1.0.0
 * @author Team Portal
 */

/* ========================================
   Loading Animation
   ======================================== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   Category Cards Container
   ======================================== */
.category-cards-wrapper {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Category Card - Enhanced Design with Watermark
   ======================================== */
.category-card {
    background: white;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 180px;
}

/* Gradient Background Overlay */
.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.category-card:hover::before {
    opacity: 1;
}

/* Hover Effects */
.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.category-card:active {
    transform: translateY(-4px) scale(1.01);
}

/* ========================================
   Card Header - Floating Icon Design
   ======================================== */
.category-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    z-index: 1;
    margin-bottom: 4px;
}

/* Floating Icon Container - Free and Colorful */
.category-card-icon {
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: visible;
    background: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Floating Animation */
@keyframes iconFloatEnhanced {
    0%, 100% { 
        transform: translateY(0) rotate(0deg); 
    }
    25% { 
        transform: translateY(-6px) rotate(2deg); 
    }
    50% { 
        transform: translateY(-12px) rotate(0deg); 
    }
    75% { 
        transform: translateY(-6px) rotate(-2deg); 
    }
}

.category-card-icon {
    animation: iconFloatEnhanced 4s ease-in-out infinite;
}

/* تأثير تكبير الأيقونة عند hover */
.category-card:hover .category-card-icon {
    transform: scale(1.2) rotate(5deg);
}

.category-card:hover .category-card-icon i {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* ألوان مختلفة لكل نوع أيقونة - ألوان نابضة بالحياة */
.category-card-icon.icon-activity {
    color: #667eea;
}

.category-card-icon.icon-legal-entity {
    color: #f5576c;
}

.category-card-icon.icon-tax-office {
    color: #00d4ff;
}

.category-card-icon.icon-activity-year {
    color: #38f9d7;
}

.category-card-icon.icon-age-group {
    color: #fa709a;
}

.category-card-icon.icon-gender {
    color: #30cfd0;
}

.category-card-icon.icon-birthplace {
    color: #a8edea;
}

.category-card-icon.icon-file-category {
    color: #2bd2ff;
}

.category-card-icon i {
    position: relative;
    z-index: 1;
}
}

/* Count Badge */
.category-card-count {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.category-card:hover .category-card-count {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

/* ========================================
   Card Body
   ======================================== */
.category-card-body {
    position: relative;
    z-index: 1;
}

.category-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px 0;
    transition: color 0.3s ease;
    line-height: 1.4;
}

.category-card:hover .category-card-title {
    color: #667eea;
}

.category-card-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    font-weight: 500;
}

/* ========================================
   Card Footer
   ======================================== */
.category-card-footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
}

.category-card-percentage {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #667eea;
}

.category-card-percentage i {
    font-size: 14px;
}

.category-card-action {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #667eea;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.category-card:hover .category-card-action {
    opacity: 1;
    transform: translateX(0);
}

.category-card-action i {
    transition: transform 0.3s ease;
}

.category-card:hover .category-card-action i {
    transform: translateX(4px);
}

/* ========================================
   Progress Bar (Optional Enhancement)
   ======================================== */
.category-card-progress {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.category-card-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.5);
}

/* ========================================
   Active/Selected State
   ======================================== */
.category-card.active,
.category-card.selected {
    border-color: #667eea;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.25);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    position: relative;
}

.category-card.active::before,
.category-card.selected::before {
    content: '✓';
    position: absolute;
    top: 12px;
    left: 12px;
    width: 28px;
    height: 28px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    z-index: 2;
    animation: checkmarkPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* ========================================
   Empty State
   ======================================== */
.category-empty i {
    animation: emptyPulse 2s ease-in-out infinite;
}

@keyframes emptyPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .category-cards-wrapper {
        padding: 15px;
    }
    
    .category-card {
        padding: 20px;
        min-height: 140px;
    }
    
    .category-card-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
    
    .category-card-count {
        font-size: 16px;
        padding: 6px 12px;
    }
    
    .category-card-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .category-cards-grid {
        grid-template-columns: 1fr !important;
    }
    
    .category-card {
        padding: 16px;
        min-height: 120px;
    }
}

/* ========================================
   Dark Mode Support (Optional)
   ======================================== */
body.dark-mode .category-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .category-card-title {
    color: #f1f5f9;
}

body.dark-mode .category-card:hover .category-card-title {
    color: #818cf8;
}

body.dark-mode .category-card-subtitle {
    color: #94a3b8;
}

body.dark-mode .category-card-footer {
    border-top-color: #334155;
}

body.dark-mode .category-cards-wrapper {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* ========================================
   Special Card Styles by Type
   ======================================== */
.category-card[data-type="activity"] {
    border-left: 4px solid #667eea;
}

.category-card[data-type="legal-entity"] {
    border-left: 4px solid #f5576c;
}

.category-card[data-type="tax-office"] {
    border-left: 4px solid #00f2fe;
}

.category-card[data-type="activity-year"] {
    border-left: 4px solid #38f9d7;
}

/* ========================================
   Animation Delays for Stagger Effect
   ======================================== */
.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; }

.category-card {
    animation: fadeInUp 0.5s ease-out backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Loading Shimmer Effect
   ======================================== */
.category-card.loading {
    position: relative;
    pointer-events: none;
}

.category-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

/* ========================================
   Tooltip on Hover (Optional)
   ======================================== */
.category-card[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    animation: tooltipFadeIn 0.2s ease;
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-5px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ========================================
   ألوان مخصصة لكل نشاط محدد
   Specific Colors for Each Activity
   ======================================== */

/* أنشطة تجارية - ألوان زرقاء */
.category-card-icon i.fa-store,
.category-card-icon i.fa-shop,
.category-card-icon i.fa-shopping-cart { color: #3b82f6 !important; }

/* أنشطة طبية - ألوان خضراء */
.category-card-icon i.fa-hospital,
.category-card-icon i.fa-clinic-medical,
.category-card-icon i.fa-user-md,
.category-card-icon i.fa-stethoscope { color: #10b981 !important; }

/* أنشطة صناعية - ألوان برتقالية */
.category-card-icon i.fa-industry,
.category-card-icon i.fa-cogs,
.category-card-icon i.fa-factory { color: #f59e0b !important; }

/* أنشطة تعليمية - ألوان أرجوانية */
.category-card-icon i.fa-graduation-cap,
.category-card-icon i.fa-school,
.category-card-icon i.fa-book { color: #8b5cf6 !important; }

/* أنشطة غذائية - ألوان حمراء */
.category-card-icon i.fa-utensils,
.category-card-icon i.fa-pizza-slice,
.category-card-icon i.fa-burger,
.category-card-icon i.fa-coffee { color: #ef4444 !important; }

/* أنشطة مهنية - ألوان سماوية */
.category-card-icon i.fa-briefcase,
.category-card-icon i.fa-user-tie,
.category-card-icon i.fa-handshake { color: #06b6d4 !important; }

/* أنشطة خدمية - ألوان وردية */
.category-card-icon i.fa-hands-helping,
.category-card-icon i.fa-concierge-bell,
.category-card-icon i.fa-broom { color: #ec4899 !important; }

/* أنشطة زراعية - ألوان خضراء داكنة */
.category-card-icon i.fa-tractor,
.category-card-icon i.fa-leaf,
.category-card-icon i.fa-seedling { color: #059669 !important; }

/* أنشطة تقنية - ألوان نيلية */
.category-card-icon i.fa-laptop-code,
.category-card-icon i.fa-microchip,
.category-card-icon i.fa-server { color: #6366f1 !important; }

/* أنشطة نقل - ألوان صفراء */
.category-card-icon i.fa-truck,
.category-card-icon i.fa-bus,
.category-card-icon i.fa-car,
.category-card-icon i.fa-taxi { color: #eab308 !important; }

/* أنشطة بناء - ألوان بنية */
.category-card-icon i.fa-hammer,
.category-card-icon i.fa-hard-hat,
.category-card-icon i.fa-building { color: #92400e !important; }

/* أنشطة فنية - ألوان قوس قزح */
.category-card-icon i.fa-palette,
.category-card-icon i.fa-paint-brush,
.category-card-icon i.fa-camera { color: #d946ef !important; }

/* أنشطة رياضية - ألوان خضراء نابضة */
.category-card-icon i.fa-dumbbell,
.category-card-icon i.fa-running,
.category-card-icon i.fa-football { color: #22c55e !important; }

/* أنشطة سياحية - ألوان فيروزية */
.category-card-icon i.fa-plane,
.category-card-icon i.fa-hotel,
.category-card-icon i.fa-map-marked-alt { color: #14b8a6 !important; }

/* كوافير وصالونات - ألوان وردية فاتحة */
.category-card-icon i.fa-cut,
.category-card-icon i.fa-scissors { color: #f472b6 !important; }

/* صيدليات - ألوان خضراء طبية */
.category-card-icon i.fa-pills,
.category-card-icon i.fa-prescription-bottle { color: #16a34a !important; }

/* مركز تنمية مهارات - ألوان برتقالية محترفة */
.category-card-icon i.fa-briefcase { color: #ea580c !important; }

/* سيارة أجرة - ألوان صفراء */
.category-card-icon i.fa-taxi { color: #facc15 !important; }

/* لون افتراضي للأنشطة غير المحددة */
.category-card-icon i { color: #667eea !important; }
