/* ========================================
   Dashboard Improvements - Modern & Responsive
   ======================================== */

/* ===== Variables ===== */
:root {
    --primary-color: #ffdf00;
    --secondary-color: #d4b800;
    --text-dark: #161823;
    --text-gray: #8a8a8e;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
    --success-color: #00c853;
    --info-color: #ffdf00;
    --warning-color: #d4b800;
    --danger-color: #f44336;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Dashboard Container ===== */
.dashboard-container {
    min-height: 100vh;
    background: var(--bg-light);
    padding: 2rem;
    direction: rtl;
}

.dashboard-container .container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== Stats Cards Grid ===== */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.dashboard-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Card Color Variants */
.dashboard-stat-card.primary {
    border-right: 4px solid var(--primary-color);
}

.dashboard-stat-card.primary .stat-icon {
    background: linear-gradient(135deg, #1a1a1a 0%, #0b0b0b 100%);
}

.dashboard-stat-card.success {
    border-right: 4px solid #ffdf00;
}

.dashboard-stat-card.success .stat-icon {
    background: linear-gradient(135deg, #ffdf00 0%, #d4b800 100%);
}

.dashboard-stat-card.info {
    border-right: 4px solid var(--info-color);
}

.dashboard-stat-card.info .stat-icon {
    background: linear-gradient(135deg, #1a1a1a 0%, #0b0b0b 100%);
}

.dashboard-stat-card.warning {
    border-right: 4px solid var(--warning-color);
}

.dashboard-stat-card.warning .stat-icon {
    background: linear-gradient(135deg, #ffdf00 0%, #d4b800 100%);
}

/* Card Content */
.stat-card-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info {
    flex: 1;
}

.stat-title {
    font-size: 0.875rem;
    color: var(--text-gray);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon img {
    width: 30px;
    height: 30px;
    filter: brightness(0) invert(1);
}

/* ===== Tables Section ===== */
.dashboard-section {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    overflow: hidden;
}

.section-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, #1a1a1a 0%, #0b0b0b 100%);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffdf00;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title-icon {
    width: 24px;
    height: 24px;
    color: #ffdf00;
}

.section-content {
    padding: 0;
}

/* ===== Modern Table ===== */
.dashboard-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dashboard-modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.dashboard-modern-table thead th {
    background: linear-gradient(135deg, #1a1a1a 0%, #0b0b0b 100%);
    color: #ffdf00;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 1rem 1.5rem;
    text-align: right;
    border: none;
    white-space: nowrap;
}

.dashboard-modern-table thead th:first-child {
    border-top-right-radius: 0;
}

.dashboard-modern-table thead th:last-child {
    border-top-left-radius: 0;
}

.dashboard-modern-table tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.dashboard-modern-table tbody tr:hover {
    background: #fafbfc;
}

.dashboard-modern-table tbody tr:last-child {
    border-bottom: none;
}

.dashboard-modern-table tbody td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    color: var(--text-dark);
    text-align: right;
    vertical-align: middle;
}

/* Table Cell Variants */
.table-cell-id {
    font-weight: 600;
    color: var(--primary-color);
}

.table-cell-name {
    font-weight: 500;
}

.table-cell-date {
    color: var(--text-gray);
    font-size: 0.813rem;
}

.table-cell-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.813rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-user {
    background: rgba(26, 26, 26, 0.08);
    color: #0b0b0b;
    border: 1px solid rgba(26, 26, 26, 0.2);
}

.badge-company {
    background: rgba(255, 223, 0, 0.15);
    color: #d4b800;
    border: 1px solid rgba(255, 223, 0, 0.3);
}

.badge-video {
    background: rgba(255, 223, 0, 0.2);
    color: #d4b800;
    border: 1px solid rgba(255, 223, 0, 0.4);
}

.badge-auction {
    background: rgba(26, 26, 26, 0.1);
    color: #1a1a1a;
    border: 1px solid rgba(26, 26, 26, 0.3);
}

.badge-success {
    background: rgba(255, 223, 0, 0.15);
    color: #d4b800;
    border: 1px solid rgba(255, 223, 0, 0.3);
}

.badge-danger {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

/* ===== Empty State ===== */
.dashboard-empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    opacity: 0.5;
}

.empty-text {
    font-size: 1rem;
    color: var(--text-gray);
    font-weight: 500;
}

/* ===== Mobile Cards View (for small screens) ===== */
.dashboard-mobile-cards {
    display: none;
}

.dashboard-mobile-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.mobile-card-id {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1rem;
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.mobile-card-label {
    font-size: 0.813rem;
    color: var(--text-gray);
    font-weight: 500;
}

.mobile-card-value {
    font-size: 0.875rem;
    color: var(--text-dark);
    font-weight: 500;
}

/* ===== Responsive Design ===== */

/* Tablet */
@media (max-width: 1024px) {
    .dashboard-container {
        padding: 1.5rem;
    }

    .dashboard-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .section-header {
        padding: 1.25rem 1.5rem;
    }

    .section-title {
        font-size: 1.125rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem;
    }

    .dashboard-stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dashboard-stat-card {
        padding: 1.25rem;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
    }

    .stat-icon img {
        width: 24px;
        height: 24px;
    }

    .section-header {
        padding: 1rem 1.25rem;
    }

    .section-title {
        font-size: 1rem;
    }

    /* Hide desktop table, show mobile cards */
    .dashboard-table-wrapper {
        display: none;
    }

    .dashboard-mobile-cards {
        display: block;
        padding: 1rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .dashboard-container {
        padding: 0.75rem;
    }

    .stat-card-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .stat-icon {
        margin-right: auto;
    }

    .section-header {
        padding: 0.875rem 1rem;
    }

    .mobile-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ===== Print Styles ===== */
@media print {
    .dashboard-container {
        background: white;
        padding: 0;
    }

    .dashboard-stat-card {
        break-inside: avoid;
    }

    .dashboard-section {
        break-inside: avoid;
    }

    .dashboard-mobile-cards {
        display: none !important;
    }

    .dashboard-table-wrapper {
        display: block !important;
    }
}
