/**
 * Dashboard Components CSS
 * Extracted from Payment Manager for reuse across all dashboard pages
 * 
 * Usage: Add class="dashboard-page" to main container, then use:
 * - .dashboard-header, .dashboard-title, .dashboard-subtitle
 * - .stats-grid > .stat-card > .stat-icon, .stat-value, .stat-label
 * - .action-grid > .action-card > .action-header, .action-icon, .action-title, .action-description
 * - .table-container, .status-badge
 */

/* =============================================================================
   DASHBOARD LAYOUT
   ============================================================================= */

.dashboard-page {
    padding: 20px 0 20px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.dashboard-page > * {
    margin-right: 20px;
}

/* Alternative theme classes */
.dashboard-page.theme-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.dashboard-page.theme-green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.dashboard-page.theme-dark {
    background: linear-gradient(135deg, #2c3e50 0%, #4a5568 100%);
}

.dashboard-page.theme-orange {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* =============================================================================
   DASHBOARD HEADER
   ============================================================================= */

.dashboard-header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.dashboard-title {
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.dashboard-subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 0;
}

/* =============================================================================
   STATS GRID (4-column metrics)
   ============================================================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =============================================================================
   PROJECT CARDS (Individual project/organization items)
   ============================================================================= */

.dashboard-page .card,
.dashboard-page .project-card,
.resource-management-page .card,
.financial-page .card {
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.dashboard-page .card:hover,
.dashboard-page .project-card:hover,
.resource-management-page .card:hover,
.financial-page .card:hover {
    border-color: rgba(102, 126, 234, 0.4) !important;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
}

/* =============================================================================
   ACTION GRID (Card panels with buttons)
   ============================================================================= */

.action-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 1400px) {
    .action-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1000px) {
    .action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .action-grid {
        grid-template-columns: 1fr;
    }
}

.action-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.action-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.action-icon {
    font-size: 2rem;
    margin-right: 15px;
    color: #667eea;
}

.action-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.action-description {
    color: #7f8c8d;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* =============================================================================
   BUTTONS (Dashboard styled)
   ============================================================================= */

.dashboard-page .btn-primary,
.btn-dashboard-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    color: white;
}

.dashboard-page .btn-primary:hover,
.btn-dashboard-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.dashboard-page .btn-secondary,
.btn-dashboard-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    border: none;
    border-radius: 25px;
    padding: 10px 25px;
    color: white;
    font-weight: 600;
    margin-left: 10px;
}

.dashboard-page .btn-danger,
.btn-dashboard-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: none;
    border-radius: 25px;
    padding: 10px 25px;
    color: white;
    font-weight: 600;
    margin-left: 10px;
}

/* =============================================================================
   TABLE CONTAINER
   ============================================================================= */

.table-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.dashboard-page .table {
    border-radius: 10px;
    overflow: hidden;
}

.dashboard-page .table thead th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =============================================================================
   STATUS BADGES
   ============================================================================= */

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.status-active,
.status-created {
    background: #3498db;
    color: white;
}

.status-pending,
.status-queued {
    background: #f39c12;
    color: white;
}

.status-processing,
.status-in-progress {
    background: #e67e22;
    color: white;
}

.status-completed,
.status-success {
    background: #27ae60;
    color: white;
}

.status-failed,
.status-error {
    background: #e74c3c;
    color: white;
}

.status-cancelled,
.status-inactive {
    background: #95a5a6;
    color: white;
}

/* =============================================================================
   LOADING & ALERTS
   ============================================================================= */

.loading-spinner {
    display: none;
    text-align: center;
    padding: 20px;
}

.dashboard-page .alert {
    border-radius: 10px;
    border: none;
    padding: 15px 20px;
    margin-bottom: 20px;
}

/* =============================================================================
   FORM CONTROLS (Dashboard styled)
   ============================================================================= */

.dashboard-page .form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
    transition: border-color 0.3s ease;
}

.dashboard-page .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* =============================================================================
   MODALS (Dashboard page override)
   ============================================================================= */

.dashboard-page .modal-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 15px 15px 0 0;
}

.dashboard-page .modal-content {
    border-radius: 15px;
    background: #ffffff;
}

.dashboard-page .modal-body {
    background: #ffffff;
    color: #212529;
}

.dashboard-page .modal-footer {
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
}

/* =============================================================================
   PROGRESS BARS
   ============================================================================= */

.dashboard-page .progress {
    height: 8px;
    border-radius: 10px;
    background: #e9ecef;
}

.dashboard-page .progress-bar {
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* =============================================================================
   TILE PATTERN ALIASES (Backward compatibility with main dashboard)
   ============================================================================= */

/* Dashboard container - alias for dashboard-page */
.dashboard-container {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Dashboard grid - 5-column layout for expanded dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

@media (max-width: 1400px) {
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard tile - compact style for 5-column layout */
.dashboard-tile {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 0;
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    overflow: hidden;
}

.dashboard-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.25), 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Tile header with colored background */
.tile-icon {
    font-size: 1.75rem;
    color: white;
    padding: 15px;
    margin-bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Color variations for tiles */
.dashboard-tile:nth-child(5n+1) .tile-icon { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.dashboard-tile:nth-child(5n+2) .tile-icon { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); }
.dashboard-tile:nth-child(5n+3) .tile-icon { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.dashboard-tile:nth-child(5n+4) .tile-icon { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.dashboard-tile:nth-child(5n+5) .tile-icon { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }

.tile-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    padding: 12px 10px 0;
}

.tile-description {
    color: #7f8c8d;
    font-size: 0.75rem;
    line-height: 1.3;
    margin-bottom: 10px;
    min-height: 28px;
    padding: 0 10px;
}

.tile-button {
    display: inline-block;
    padding: 6px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 12px;
    transition: opacity 0.3s ease, transform 0.2s ease;
}

.tile-button:hover {
    opacity: 0.9;
    color: white;
    transform: translateY(-2px);
}

/* Card styling for dashboard context */
.dashboard-container .card,
.dashboard-page .card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.dashboard-container .card-header,
.dashboard-page .card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Dashboard header with title styling */
.dashboard-header h1,
.dashboard-header .dashboard-title {
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.dashboard-header p,
.dashboard-header .dashboard-subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 0;
}
