/**
 * Clients Cards View
 * عرض العملاء على شكل بطاقات بدلاً من الجدول
 * 
 * @version 1.0.5
 */

/* ========================================
   Cards Container
   ======================================== */
.clients-cards-view {
    padding: 20px;
    display: none; /* مخفي افتراضياً */
    width: 100%;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 20px;
    width: 100%;
}

/* ========================================
   Client Card
   ======================================== */
.client-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 2px solid #e5e7eb;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.client-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

/* ========================================
   Card Avatar Section
   ======================================== */
.card-avatar-section {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.card-avatar,
.card-avatar-initials {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #667eea;
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.25);
}

.card-avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 32px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================
   Card Header
   ======================================== */
.card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
    text-align: center;
}

.card-name {
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 10px 0;
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    word-break: break-word;
    max-width: 100%;
}

.card-file-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
    white-space: nowrap;
}

.card-file-number i {
    font-size: 10px;
}

/* ========================================
   Card Body
   ======================================== */
.card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-info-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #4b5563;
    padding: 10px;
    background: #f9fafb;
    border-radius: 8px;
    transition: background 0.2s ease;
    min-height: 40px;
}

.card-info-row:hover {
    background: #f3f4f6;
}

.card-info-row i {
    color: #667eea;
    width: 18px;
    min-width: 18px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.card-info-row span {
    flex: 1;
    font-weight: 500;
    line-height: 1.5;
    word-break: break-word;
}

/* ========================================
   Card Badges
   ======================================== */
.card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 2px solid #e5e7eb;
}

.card-badges .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card-badges .badge i {
    font-size: 9px;
}

.card-badges .vat-badge {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.card-badges .law6-badge {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.card-badges .inv-badge {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.card-badges .social-insurance-badge {
    background: #fce7f3;
    color: #9f1239;
    border: 1px solid #f9a8d4;
}

/* ========================================
   Toggle Button Styles
   ======================================== */
.view-toggle-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
}

.view-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
}

.view-toggle-btn i {
    margin-left: 6px;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1400px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 992px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 10px;
    }
    
    .clients-cards-view {
        padding: 10px;
    }
    
    .client-card {
        padding: 20px;
        max-width: 600px;
        margin: 0 auto;
    }
    
    .card-name {
        font-size: 16px;
    }
    
    .card-avatar,
    .card-avatar-initials {
        width: 75px;
        height: 75px;
    }
    
    .card-avatar-initials {
        font-size: 28px;
    }
    
    .card-info-row {
        font-size: 12px;
        padding: 8px;
    }
    
    .card-badges .badge {
        font-size: 9px;
        padding: 4px 8px;
    }
}

/* ========================================
   Animation
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.client-card {
    animation: fadeInUp 0.3s ease-out;
}

.client-card:nth-child(1) { animation-delay: 0.05s; }
.client-card:nth-child(2) { animation-delay: 0.1s; }
.client-card:nth-child(3) { animation-delay: 0.15s; }
.client-card:nth-child(4) { animation-delay: 0.2s; }
.client-card:nth-child(5) { animation-delay: 0.25s; }
.client-card:nth-child(6) { animation-delay: 0.3s; }
