/*
 * Page-Specific Custom Styles
 * Reusable CSS classes for ticketing system pages
 */

/* =====================================================
   KPI CARDS - Reusable across dashboard and reports
   ===================================================== */

.kpi-card {
    border-radius: 16px;
    padding: 1.5rem;
    color: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 140px;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255,255,255,0.1);
    transform: rotate(45deg);
}

.kpi-card-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.kpi-card-red {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.kpi-card-purple {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.kpi-card-green {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.kpi-card-orange {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.kpi-card-teal {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.kpi-icon {
    font-size: 2.5rem;
    opacity: 0.3;
    position: absolute;
    right: 20px;
    bottom: 20px;
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    position: relative;
    z-index: 1;
}

.kpi-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.5rem;
    position: relative;
    z-index: 1;
}

/* Pulsing animation for critical items */
.kpi-card-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}

/* =====================================================
   PRIORITY & STATUS BADGES - Reusable badges
   ===================================================== */

/* Priority Color Coding */
.priority-low {
    background: #fff3cd;
    color: #856404;
}

.priority-medium {
    background: #ffeccf;
    color: #cc6600;
}

.priority-high {
    background: #f8d7da;
    color: #721c24;
}

.priority-critical {
    background: #dc3545;
    color: #ffffff;
    font-weight: bold;
}

/* Status Badges */
.status-submitted {
    background: #d1ecf1;
    color: #0c5460;
}

.status-reviewed {
    background: #d4edda;
    color: #155724;
}

.status-ready {
    background: #cfe2ff;
    color: #084298;
}

.status-moreinfo {
    background: #fff3cd;
    color: #856404;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

.status-badge, .priority-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    text-align: center;
}

/* Project status badges */
.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-completed {
    background: #d1ecf1;
    color: #0c5460;
}

/* =====================================================
   CHART CONTAINERS - Reusable chart wrappers
   ===================================================== */

.chart-container {
    position: relative;
    height: 300px;
    padding: 1rem;
}

.chart-container-small {
    height: 200px;
}

.chart-container-large {
    height: 400px;
}

/* =====================================================
   ACTIVITY FEED - Reusable activity timeline
   ===================================================== */

.activity-feed {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    padding: 1rem;
    border-left: 3px solid #667eea;
    margin-bottom: 1rem;
    background: white;
    border-radius: 0 8px 8px 0;
    transition: all 0.2s ease;
}

.activity-item:hover {
    background: #f8fafc;
    border-left-width: 5px;
    padding-left: 1.5rem;
}

.activity-time {
    font-size: 0.75rem;
    color: #94a3b8;
}

.activity-item-success {
    border-left-color: #10b981;
}

.activity-item-warning {
    border-left-color: #f59e0b;
}

.activity-item-danger {
    border-left-color: #ef4444;
}

/* =====================================================
   OVERDUE/ALERT ITEMS - Warning sections
   ===================================================== */

.overdue-item {
    padding: 0.75rem 1rem;
    border-left: 4px solid #ef4444;
    background: #fef2f2;
    margin-bottom: 0.5rem;
    border-radius: 0 8px 8px 0;
    transition: all 0.2s ease;
}

.overdue-item:hover {
    background: #fee2e2;
    padding-left: 1.25rem;
}

.overdue-critical {
    border-left-color: #dc2626;
    background: #fee2e2;
    font-weight: 500;
}

.overdue-warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

/* =====================================================
   DATE FILTERS - Reusable filter buttons
   ===================================================== */

.date-filter-btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 8px !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.date-filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.date-filter-btn:not(.active):hover {
    background: #f1f5f9 !important;
    border-color: #667eea !important;
    color: #667eea !important;
}

/* =====================================================
   LOADING STATES - Skeleton loaders
   ===================================================== */

.skeleton-loader {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
    height: 20px;
    margin-bottom: 0.5rem;
}

.skeleton-card {
    min-height: 140px;
    border-radius: 16px;
}

.skeleton-chart {
    height: 300px;
    border-radius: 12px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Loading spinner overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: inherit;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   STATS WIDGETS - Small stat cards
   ===================================================== */

.stat-widget {
    padding: 1rem;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.stat-widget:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.stat-widget-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.stat-widget-icon-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-widget-icon-green {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.stat-widget-icon-red {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.stat-widget-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.stat-widget-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* =====================================================
   TICKET THUMBNAILS - Image previews
   ===================================================== */

.ticket-thumbnail {
    max-width: 100px;
    max-height: 100px;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.ticket-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* =====================================================
   EMPTY STATES - No data messages
   ===================================================== */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}

.empty-state-icon {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.empty-state-description {
    font-size: 0.875rem;
    color: #94a3b8;
}

/* =====================================================
   INFO BOXES - Highlighted information
   ===================================================== */

.info-box {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border-left: 4px solid;
    margin-bottom: 1rem;
}

.info-box-info {
    background: #eff6ff;
    border-left-color: #3b82f6;
    color: #1e40af;
}

.info-box-success {
    background: #f0fdf4;
    border-left-color: #10b981;
    color: #065f46;
}

.info-box-warning {
    background: #fffbeb;
    border-left-color: #f59e0b;
    color: #92400e;
}

.info-box-danger {
    background: #fef2f2;
    border-left-color: #ef4444;
    color: #991b1b;
}

/* =====================================================
   PROGRESS BARS - Status progress indicators
   ===================================================== */

.progress-bar-custom {
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.progress-bar-success {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.progress-bar-warning {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.progress-bar-danger {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

/* =====================================================
   QUICK ACTIONS - Floating action buttons
   ===================================================== */

.quick-action-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
}

.quick-action-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.5);
}

/* =====================================================
   RESPONSIVE ADJUSTMENTS
   ===================================================== */

@media (max-width: 768px) {
    .kpi-card {
        min-height: 120px;
    }

    .kpi-value {
        font-size: 2rem;
    }

    .kpi-icon {
        font-size: 2rem;
    }

    .chart-container {
        height: 250px;
    }

    .activity-feed {
        max-height: 300px;
    }

    .date-filter-btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    .quick-action-btn {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
        bottom: 1rem;
        right: 1rem;
    }
}

@media (max-width: 576px) {
    .kpi-card {
        margin-bottom: 1rem;
    }

    .stat-widget {
        margin-bottom: 1rem;
    }
}

/* =====================================================
   PRINT STYLES - For printing reports
   ===================================================== */

@media print {
    .kpi-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }

    .date-filter-btn,
    .quick-action-btn {
        display: none !important;
    }

    .chart-container {
        page-break-inside: avoid;
    }
}
