/**
 * Baladi Employee Tracker - Extended Dashboard Styles
 * iOS Native Styling for Dashboard Components
 * AI translation, task assignments, employee cards, mobile filters
 */

/* ========================================
   CHECKBOX ITEM - iOS Toggle Style
   ======================================== */

#bet-dashboard .bet-checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--ios-space-md, 12px);
    padding: var(--ios-space-md, 12px) var(--ios-space-lg, 16px);
    background: var(--ios-bg-grouped-secondary, #FFFFFF);
    border: 1px solid var(--ios-gray-5, #E5E5EA);
    border-radius: var(--ios-radius-md, 12px);
    cursor: pointer;
    transition: all var(--ios-transition-fast, 0.15s ease);
    font-size: var(--ios-text-base, 15px);
}

#bet-dashboard .bet-checkbox-item:hover {
    background: var(--ios-gray-6, #F2F2F7);
    border-color: var(--ios-gray-4, #D1D1D6);
}

#bet-dashboard .bet-checkbox-item:active {
    background: var(--ios-gray-5, #E5E5EA);
}

#bet-dashboard .bet-checkbox-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--ios-blue, #007AFF);
    border-radius: 6px;
}

/* ========================================
   TAGS - iOS Pill Style
   ======================================== */

#bet-dashboard .bet-tag-purple {
    background: rgba(175, 82, 222, 0.12);
    color: var(--ios-purple, #AF52DE);
}

#bet-dashboard .bet-tag-indigo {
    background: rgba(88, 86, 214, 0.12);
    color: var(--ios-indigo, #5856D6);
}

#bet-dashboard .bet-tag-teal {
    background: rgba(90, 200, 250, 0.12);
    color: var(--ios-teal, #5AC8FA);
}

/* ========================================
   CURRENT TASK CARDS - Active Tasks
   ======================================== */

#bet-dashboard .bet-current-task-card {
    display: flex;
    align-items: center;
    gap: var(--ios-space-lg, 16px);
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.08) 0%, rgba(52, 199, 89, 0.15) 100%);
    padding: var(--ios-space-lg, 16px) var(--ios-space-xl, 20px);
    border-radius: var(--ios-radius-xl, 20px);
    border-inline-start: 4px solid var(--ios-green, #34C759);
    transition: all var(--ios-transition-fast, 0.15s ease);
}

#bet-dashboard .bet-current-task-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ios-shadow-md, 0 4px 12px rgba(0, 0, 0, 0.08));
}

#bet-dashboard .bet-current-task-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--ios-green, #34C759);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--ios-font-bold, 700);
    font-size: var(--ios-text-base, 15px);
    flex-shrink: 0;
}

#bet-dashboard .bet-current-task-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

#bet-dashboard .bet-current-task-info strong {
    font-size: var(--ios-text-md, 17px);
    font-weight: var(--ios-font-semibold, 600);
    color: var(--ios-label, #000000);
}

#bet-dashboard .bet-current-task-desc {
    font-size: var(--ios-text-sm, 13px);
    color: #2e7d32;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#bet-dashboard .bet-current-task-time {
    background: rgba(46, 125, 50, 0.15);
    color: #2e7d32;
    padding: var(--ios-space-sm, 8px) var(--ios-space-md, 12px);
    border-radius: var(--ios-radius-full, 9999px);
    font-size: var(--ios-text-sm, 13px);
    font-weight: var(--ios-font-semibold, 600);
    font-family: var(--ios-font-mono, 'SF Mono', monospace);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* ========================================
   ACTIVE EMPLOYEE CARDS
   ======================================== */

#bet-dashboard .bet-active-employee-card {
    display: flex;
    align-items: center;
    gap: var(--ios-space-md, 12px);
    background: var(--ios-bg-grouped-secondary, #FFFFFF);
    padding: var(--ios-space-lg, 16px);
    border-radius: var(--ios-radius-xl, 20px);
    border: 1px solid var(--ios-gray-5, #E5E5EA);
    cursor: pointer;
    transition: all var(--ios-transition-fast, 0.15s ease);
}

#bet-dashboard .bet-active-employee-card:hover {
    border-color: var(--ios-blue, #007AFF);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.15);
    transform: translateY(-2px);
}

#bet-dashboard .bet-active-employee-card:active {
    transform: scale(0.98);
    opacity: 0.9;
}

#bet-dashboard .bet-active-emp-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5856D6 0%, #AF52DE 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--ios-font-bold, 700);
    font-size: var(--ios-text-sm, 13px);
    flex-shrink: 0;
}

#bet-dashboard .bet-active-emp-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

#bet-dashboard .bet-active-emp-info strong {
    font-size: var(--ios-text-base, 15px);
    font-weight: var(--ios-font-semibold, 600);
    color: var(--ios-label, #000000);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#bet-dashboard .bet-active-emp-status {
    font-size: var(--ios-text-sm, 13px);
    color: var(--ios-label-secondary, #3C3C43);
}

#bet-dashboard .bet-active-emp-time {
    font-size: var(--ios-text-xs, 11px);
    font-weight: var(--ios-font-medium, 500);
    color: var(--ios-label-tertiary, #3C3C4399);
    background: var(--ios-gray-6, #F2F2F7);
    padding: 4px 10px;
    border-radius: var(--ios-radius-full, 9999px);
    font-family: var(--ios-font-mono, 'SF Mono', monospace);
}

/* ========================================
   EMPLOYEE PROFILE MODAL
   ======================================== */

#bet-dashboard .bet-profile-header {
    display: flex;
    align-items: center;
    gap: var(--ios-space-xl, 20px);
    padding-bottom: var(--ios-space-xl, 20px);
    border-bottom: 0.5px solid var(--ios-gray-4, #D1D1D6);
    margin-bottom: var(--ios-space-xl, 20px);
}

#bet-dashboard .bet-profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5856D6 0%, #AF52DE 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--ios-font-bold, 700);
    font-size: var(--ios-text-xl, 22px);
    flex-shrink: 0;
}

#bet-dashboard .bet-profile-info h3 {
    margin: 0 0 var(--ios-space-xs, 4px) 0;
    font-size: var(--ios-text-xl, 22px);
    font-weight: var(--ios-font-bold, 700);
    color: var(--ios-label, #000000);
}

#bet-dashboard .bet-profile-info p {
    margin: 0;
    color: var(--ios-label-secondary, #3C3C43);
    font-size: var(--ios-text-base, 15px);
}

#bet-dashboard .bet-profile-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--ios-space-md, 12px);
    margin-bottom: var(--ios-space-xl, 20px);
}

#bet-dashboard .bet-profile-detail {
    background: var(--ios-gray-6, #F2F2F7);
    padding: var(--ios-space-md, 12px);
    border-radius: var(--ios-radius-md, 12px);
    font-size: var(--ios-text-sm, 13px);
}

#bet-dashboard .bet-profile-detail strong {
    display: block;
    font-size: var(--ios-text-xs, 11px);
    font-weight: var(--ios-font-semibold, 600);
    color: var(--ios-label-secondary, #3C3C43);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

#bet-dashboard .bet-profile-history h4 {
    margin: 0 0 var(--ios-space-lg, 16px) 0;
    font-size: var(--ios-text-md, 17px);
    font-weight: var(--ios-font-semibold, 600);
    color: var(--ios-label, #000000);
}

/* ========================================
   SETTINGS CHECKBOX GROUP
   ======================================== */

#bet-dashboard .bet-checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--ios-space-md, 12px);
    cursor: pointer;
    font-size: var(--ios-text-md, 17px);
}

#bet-dashboard .bet-checkbox-label input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--ios-blue, #007AFF);
    border-radius: 6px;
}

#bet-dashboard .bet-checkbox-text {
    font-weight: var(--ios-font-regular, 400);
    color: var(--ios-label, #000000);
}

/* ========================================
   MOBILE FILTER TOGGLE
   ======================================== */

@media screen and (max-width: 768px) {
    #bet-dashboard .bet-filter-toggle {
        display: flex;
    }
    
    #bet-dashboard .bet-filter-content {
        display: none;
        flex-direction: column;
    }
    
    #bet-dashboard .bet-filter-content.bet-expanded {
        display: flex;
    }
    
    #bet-dashboard .bet-filter-group {
        width: 100%;
    }
    
    #bet-dashboard .bet-input-with-btn {
        flex-direction: column;
    }
    
    #bet-dashboard .bet-btn-ai {
        width: 100%;
    }
    
    #bet-dashboard .bet-modal-wide {
        max-width: 100%;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    #bet-dashboard .bet-checkbox-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    
    #bet-dashboard .bet-profile-details {
        grid-template-columns: 1fr;
    }
    
    #bet-dashboard .bet-active-employees-grid {
        grid-template-columns: 1fr;
    }
    
    #bet-dashboard .bet-current-task-card {
        flex-wrap: wrap;
    }
    
    #bet-dashboard .bet-profile-header {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   MOBILE - SMALL PHONES
   ======================================== */

@media screen and (max-width: 480px) {
    #bet-dashboard .bet-modal-box {
        padding: var(--ios-space-lg, 16px);
        margin: 20px auto;
    }
    
    #bet-dashboard .bet-form-section {
        padding: var(--ios-space-md, 12px);
    }
    
    #bet-dashboard .bet-form-row {
        grid-template-columns: 1fr;
    }
    
    #bet-dashboard .bet-current-task-time {
        width: 100%;
        text-align: center;
        margin-top: var(--ios-space-sm, 8px);
    }
    
    #bet-dashboard .bet-profile-avatar {
        width: 64px;
        height: 64px;
        font-size: var(--ios-text-lg, 20px);
    }
}

/* ========================================
   RTL SUPPORT
   ======================================== */

[dir="rtl"] #bet-dashboard .bet-current-task-card {
    border-inline-start: none;
    border-inline-end: 4px solid var(--ios-green, #34C759);
}

[dir="rtl"] #bet-dashboard .bet-profile-header {
    flex-direction: row-reverse;
}

[dir="rtl"] #bet-dashboard .bet-active-employee-card {
    flex-direction: row-reverse;
}

[dir="rtl"] #bet-dashboard .bet-current-task-card {
    flex-direction: row-reverse;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* High contrast mode */
@media (prefers-contrast: high) {
    #bet-dashboard .bet-checkbox-item,
    #bet-dashboard .bet-active-employee-card {
        border-width: 2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    #bet-dashboard .bet-current-task-card,
    #bet-dashboard .bet-active-employee-card,
    #bet-dashboard .bet-checkbox-item {
        transition: none;
    }
    
    #bet-dashboard .bet-live-badge {
        animation: none;
    }
}

/* Focus visible states */
#bet-dashboard .bet-checkbox-item:focus-visible,
#bet-dashboard .bet-active-employee-card:focus-visible {
    outline: 3px solid var(--ios-blue, #007AFF);
    outline-offset: 2px;
}

/* ========================================
   IMAGES GALLERY - iOS Grid Style
   ======================================== */

#bet-dashboard .bet-images-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--ios-space-lg, 16px);
    padding: var(--ios-space-lg, 16px);
}

#bet-dashboard .bet-image-card {
    background: var(--ios-bg-grouped-secondary, #FFFFFF);
    border-radius: var(--ios-radius-xl, 20px);
    overflow: hidden;
    box-shadow: var(--ios-shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.04));
    transition: all var(--ios-transition-fast, 0.15s ease);
    cursor: pointer;
}

#bet-dashboard .bet-image-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ios-shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.12));
}

#bet-dashboard .bet-image-card:active {
    transform: translateY(-2px);
    box-shadow: var(--ios-shadow-md, 0 4px 12px rgba(0, 0, 0, 0.08));
}

#bet-dashboard .bet-image-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    background: var(--ios-gray-6, #F2F2F7);
}

#bet-dashboard .bet-image-info {
    padding: var(--ios-space-md, 12px);
}

#bet-dashboard .bet-image-task {
    font-weight: var(--ios-font-semibold, 600);
    font-size: var(--ios-text-sm, 14px);
    color: var(--ios-label-primary, #000000);
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#bet-dashboard .bet-image-employee {
    font-size: var(--ios-text-xs, 12px);
    color: var(--ios-label-secondary, #8E8E93);
    margin: 0 0 4px 0;
}

#bet-dashboard .bet-image-date {
    font-size: var(--ios-text-xs, 12px);
    color: var(--ios-label-tertiary, #C7C7CC);
    margin: 0;
}

#bet-dashboard .bet-images-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--ios-space-3xl, 48px) var(--ios-space-xl, 20px);
    color: var(--ios-label-secondary, #8E8E93);
}

#bet-dashboard .bet-images-empty-icon {
    font-size: 48px;
    margin-bottom: var(--ios-space-md, 12px);
}

#bet-dashboard .bet-images-empty-text {
    font-size: var(--ios-text-base, 15px);
}

/* Image Lightbox Modal */
#bet-dashboard .bet-image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--ios-space-xl, 20px);
}

#bet-dashboard .bet-image-lightbox.bet-active {
    display: flex;
}

#bet-dashboard .bet-lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

#bet-dashboard .bet-lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--ios-radius-lg, 16px);
}

#bet-dashboard .bet-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--ios-transition-fast, 0.15s ease);
}

#bet-dashboard .bet-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

#bet-dashboard .bet-lightbox-info {
    color: white;
    text-align: center;
    margin-top: var(--ios-space-lg, 16px);
}

#bet-dashboard .bet-lightbox-task {
    font-weight: var(--ios-font-semibold, 600);
    font-size: var(--ios-text-lg, 20px);
    margin: 0 0 8px 0;
}

#bet-dashboard .bet-lightbox-meta {
    font-size: var(--ios-text-sm, 14px);
    opacity: 0.8;
    margin: 0;
}

/* Mobile responsive for images gallery */
@media screen and (max-width: 768px) {
    #bet-dashboard .bet-images-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--ios-space-md, 12px);
        padding: var(--ios-space-md, 12px);
    }
    
    #bet-dashboard .bet-image-thumb {
        height: 120px;
    }
}

@media screen and (max-width: 480px) {
    #bet-dashboard .bet-images-gallery {
        grid-template-columns: 1fr 1fr;
    }
    
    #bet-dashboard .bet-image-thumb {
        height: 100px;
    }
    
    #bet-dashboard .bet-image-info {
        padding: var(--ios-space-sm, 8px);
    }
}
