/* OnlyProfit Admin - Global Styles */

/* ========== Base & Typography ========== */
body {
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== Scrollbar Styling ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(128, 128, 128, 0.4);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(128, 128, 128, 0.6);
}

/* ========== AppBar Improvements ========== */
.mud-appbar {
    backdrop-filter: blur(8px);
}

.mud-appbar .mud-input-outlined .mud-input-outlined-border {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.mud-appbar .mud-input-outlined:hover .mud-input-outlined-border {
    border-color: rgba(255, 255, 255, 0.35) !important;
}

.mud-appbar .mud-input-outlined.mud-input-adorned-start input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* ========== Drawer / NavMenu ========== */
.mud-drawer {
    border-right: 1px solid rgba(128, 128, 128, 0.12);
}

.mud-nav-link {
    border-radius: 8px !important;
    margin: 2px 8px !important;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.mud-nav-link.active {
    font-weight: 600;
}

.mud-navmenu .mud-nav-group .mud-collapse-container .mud-nav-link {
    padding-left: 36px !important;
    font-size: 0.875rem;
}

/* ========== Page Headers ========== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h4,
.page-header .mud-typography-h4 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* ========== Cards & Papers ========== */
.mud-paper {
    border-radius: 12px !important;
    transition: box-shadow 0.2s ease;
}

.mud-card {
    border-radius: 12px !important;
}

/* ========== Tables ========== */
.mud-table .mud-table-head .mud-table-cell {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mud-palette-text-secondary);
}

.mud-table-row:hover {
    transition: background-color 0.15s ease-in-out;
}

/* ========== DataGrid ========== */
.mud-data-grid .mud-table-head .mud-table-cell {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mud-palette-text-secondary);
}

/* ========== Chips ========== */
.mud-chip {
    font-weight: 500;
}

/* ========== Dialogs ========== */
.mud-dialog .mud-dialog-content {
    padding-top: 16px;
}

.mud-dialog {
    border-radius: 16px !important;
}

/* ========== Dashboard Panels ========== */
.dashboard-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard-panel .mud-list,
.dashboard-panel .mud-timeline,
.dashboard-panel .d-flex.flex-column {
    flex: 1;
}

/* ========== Heatmap ========== */
.heatmap-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
}

.heatmap-table th {
    text-align: center;
    font-size: 10px;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
    padding: 4px 0;
}

.heatmap-table td.heatmap-day-label {
    font-size: 12px;
    font-weight: 600;
    padding-right: 8px;
    white-space: nowrap;
    color: var(--mud-palette-text-secondary);
}

.heatmap-cell {
    height: 28px;
    min-width: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.heatmap-cell:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1;
    position: relative;
}

.heatmap-cell span {
    font-size: 9px;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

/* ========== Platform Metrics ========== */
.metric-value {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.metric-label {
    font-size: 0.875rem;
    margin-top: 4px;
}

/* ========== Filter Bar ========== */
.filter-bar {
    flex-wrap: wrap;
    gap: 12px;
}

/* ========== Empty States ========== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.empty-state .mud-icon-root {
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ========== Loading States ========== */
.mud-skeleton {
    border-radius: 8px !important;
}

/* ========== Status Indicators ========== */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background-color: var(--mud-palette-success);
    box-shadow: 0 0 8px var(--mud-palette-success);
}

.status-dot.offline {
    background-color: var(--mud-palette-grey-default);
}

/* ========== Monospace for IDs ========== */
.monospace {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

/* ========== Animations ========== */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== Login Page ========== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0D1117 0%, #161B22 50%, #1a2332 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

/* ========== Drawer Details ========== */
.mud-drawer.mud-drawer-right {
    border-left: 1px solid rgba(128, 128, 128, 0.12);
}

/* ========== Responsive ========== */
@media (max-width: 960px) {
    .mud-appbar .search-field {
        display: none;
    }
}

@media (max-width: 600px) {
    .mud-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* ========== Cursor Utilities ========== */
.cursor-pointer {
    cursor: pointer;
}

.cursor-pointer:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.04) !important;
}

/* ========== Misc ========== */
.text-right {
    text-align: right;
}

.font-weight-bold {
    font-weight: 600 !important;
}

/* Selection highlight for code/monospace */
.mud-paper pre::selection,
.monospace::selection {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.3);
}
