/* ============================================
   GeniAI Dashboard - Custom Styles
   ============================================ */

:root {
    --primary-color: #0d6efd;
    --marketing-color: #6f42c1;
    --utility-color: #20c997;
    --revenue-color: #0dcaf0;
    --profit-color: #198754;
    --cost-color: #dc3545;
    --dark-bg: #1a1d21;
    --card-bg: #ffffff;
    --text-muted: #6c757d;
}

/* ============================================
   Global Styles
   ============================================ */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f5f7fa;
}

/* ============================================
   Login Page Styles
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-container {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.logo-icon {
    font-size: 36px;
    color: white;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1d21;
    margin-bottom: 5px;
}

.login-form .form-control {
    padding: 12px 16px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.login-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.15);
}

.login-form .btn-primary {
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.login-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.3);
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* ============================================
   Dashboard Page Styles
   ============================================ */
.dashboard-page {
    padding-top: 70px;
}

.main-content {
    padding: 20px;
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
}

/* Filter Card */
.filter-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.filter-card .form-control {
    border-radius: 8px;
}

/* Stat Cards */
.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.stat-card .card-title {
    font-size: 2rem;
    font-weight: 700;
}

.stat-card .card-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.marketing {
    background: rgba(111, 66, 193, 0.1);
    color: var(--marketing-color);
}

.stat-icon.utility {
    background: rgba(32, 201, 151, 0.1);
    color: var(--utility-color);
}

.stat-icon.revenue {
    background: rgba(13, 202, 240, 0.1);
    color: var(--revenue-color);
}

.stat-icon.profit {
    background: rgba(25, 135, 84, 0.1);
    color: var(--profit-color);
}

/* Marketing Card */
.marketing-card {
    border-left: 4px solid var(--marketing-color);
}

/* Utility Card */
.utility-card {
    border-left: 4px solid var(--utility-color);
}

/* Revenue Card */
.revenue-card {
    border-left: 4px solid var(--revenue-color);
}

/* Profit Card */
.profit-card {
    border-left: 4px solid var(--profit-color);
}

/* Detail Cards */
.detail-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.detail-card .card-header {
    border-bottom: 1px solid #e9ecef;
    border-radius: 12px 12px 0 0 !important;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.detail-label {
    display: flex;
    align-items: center;
    color: var(--text-muted);
}

.detail-value {
    font-weight: 600;
    font-size: 1.1rem;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 10px;
}

.indicator.marketing {
    background-color: var(--marketing-color);
}

.indicator.utility {
    background-color: var(--utility-color);
}

.indicator.cost {
    background-color: var(--cost-color);
}

/* Top Companies */
.top-company-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.top-company-item:last-child {
    border-bottom: none;
}

.top-company-rank {
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
}

.top-company-name {
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-company-value {
    font-weight: 600;
    color: var(--profit-color);
}

/* Progress Bar */
.progress {
    border-radius: 10px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Table */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 2px solid #e9ecef;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 15px 12px;
}

.table tbody td {
    padding: 15px 12px;
    vertical-align: middle;
    border-color: #f0f0f0;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Pagination */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: none;
    color: var(--text-muted);
}

.pagination .page-link:hover {
    background-color: #e9ecef;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    color: white;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

/* Responsive */
@media (max-width: 768px) {
    .stat-card .card-title {
        font-size: 1.5rem;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .filter-card .btn {
        margin-top: 10px;
    }
}

/* Chart Container */
#dispatchChart {
    max-height: 300px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card,
.detail-card,
.card {
    animation: fadeIn 0.5s ease-out;
}

/* Utility Classes */
.text-marketing {
    color: var(--marketing-color) !important;
}

.text-utility {
    color: var(--utility-color) !important;
}

.text-revenue {
    color: var(--revenue-color) !important;
}

.text-profit {
    color: var(--profit-color) !important;
}

.bg-marketing {
    background-color: var(--marketing-color) !important;
}

.bg-utility {
    background-color: var(--utility-color) !important;
}
