/**
 * Sistem Absensi SIXNINE GARAGE
 * Compact & Mobile Responsive CSS
 */

:root {
    --primary: #0d6efd;
    --success: #198754;
    --warning: #ffc107;
    --danger: #dc3545;
    --dark: #1a1a2e;
    --darker: #16162a;
    --card-bg: #242442;
    --text-muted: #b0b0c0;
    --text-light: #e8e8f0;
}

/* Base */
body {
    font-size: 14px;
    background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 100%);
    min-height: 100vh;
    color: var(--text-light);
}

/* Compact Cards */
.card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.card-header {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.card-body {
    padding: 0.75rem;
}

/* Portal Buttons */
.portal-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.portal-card {
    max-width: 400px;
    width: 100%;
}

.portal-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    color: white;
}

.portal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    color: white;
}

.portal-btn i {
    font-size: 1.25rem;
}

.portal-btn.absen {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
}

.portal-btn.keuangan {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
}

.portal-btn.hrd {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #000;
}

.portal-btn.hrd:hover {
    color: #000;
}

.portal-btn.bos {
    background: linear-gradient(135deg, #dc3545 0%, #bb2d3b 100%);
}

/* Compact Tables */
.table {
    font-size: 0.8rem;
    margin-bottom: 0;
}

.table th,
.table td {
    padding: 0.4rem 0.5rem;
    vertical-align: middle;
}

.table-dark {
    --bs-table-bg: transparent;
    --bs-table-border-color: rgba(255, 255, 255, 0.1);
}

.table-dark th {
    background: rgba(0, 0, 0, 0.3);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Compact Buttons */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Stats Cards */
.stat-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 0.75rem;
    border-left: 3px solid var(--primary);
}

.stat-card.success {
    border-left-color: var(--success);
}

.stat-card.warning {
    border-left-color: var(--warning);
}

.stat-card.danger {
    border-left-color: var(--danger);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Clock Button */
.clock-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
}

.clock-btn:hover {
    transform: scale(1.05);
}

.clock-btn i {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.clock-btn.clock-in {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
    box-shadow: 0 4px 20px rgba(25, 135, 84, 0.4);
}

.clock-btn.clock-out {
    background: linear-gradient(135deg, #dc3545 0%, #bb2d3b 100%);
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.4);
}

/* Time Display */
.time-display {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: monospace;
    color: #fff;
}

.date-display {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Badges */
.badge {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
}

/* Forms */
.form-control,
.form-select {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e0e0e0;
}

.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

/* Fix dropdown options text color */
.form-select option {
    background-color: #fff;
    color: #333;
}

.form-label {
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-muted);
}

/* Ranking */
.ranking-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.ranking-position {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    margin-right: 0.75rem;
}

.ranking-position.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    color: #000;
}

.ranking-position.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
    color: #000;
}

.ranking-position.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #a66b2a 100%);
    color: #fff;
}

.ranking-position.normal {
    background: rgba(255, 255, 255, 0.1);
}

.ranking-name {
    flex: 1;
    font-size: 0.85rem;
}

.ranking-hours {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

/* Modal Compact */
.modal-content {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 0.75rem;
}

.modal-title {
    font-size: 0.95rem;
}

/* Mobile Responsive */
@media (max-width: 576px) {
    body {
        font-size: 13px;
    }

    .portal-btn {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }

    .portal-btn i {
        font-size: 1.1rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .clock-btn {
        width: 100px;
        height: 100px;
    }

    .clock-btn i {
        font-size: 1.5rem;
    }

    .time-display {
        font-size: 2rem;
    }

    .table {
        font-size: 0.75rem;
    }

    .table th,
    .table td {
        padding: 0.3rem 0.4rem;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--darker);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Utils */
.text-muted {
    color: var(--text-muted) !important;
}

.fs-7 {
    font-size: 0.85rem;
}

.fs-8 {
    font-size: 0.75rem;
}

/* Enhanced text visibility */
.small.text-muted,
.ranking-name .small.text-muted,
.stat-card .small.text-muted {
    color: #a0a0b8 !important;
}

/* Table text visibility */
.table-dark td,
.table-dark th {
    color: var(--text-light);
}

/* Card header visibility */
.card-header {
    color: var(--text-light);
}

/* Ranking item text */
.ranking-name {
    color: var(--text-light);
}

/* Badge text visibility */
.badge {
    font-weight: 600;
}

/* Navbar text visibility */
.navbar-dark .navbar-nav .nav-link {
    color: var(--text-light);
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: #fff;
}

/* Override Bootstrap text colors for dark theme visibility */
.text-success {
    color: #4ade80 !important;
    /* Brighter green */
}

.text-danger {
    color: #f87171 !important;
    /* Brighter red */
}

.text-warning {
    color: #fbbf24 !important;
    /* Brighter yellow */
}

.text-info {
    color: #38bdf8 !important;
    /* Brighter cyan */
}

.text-primary {
    color: #60a5fa !important;
    /* Brighter blue */
}

/* Table specific text visibility fixes */
.table td.text-muted,
.table .text-muted {
    color: #94a3b8 !important;
    /* Visible gray */
}

/* Nav tabs fix for dark theme */
.nav-tabs .nav-link {
    color: #d1d5db;
}

.nav-tabs .nav-link.active {
    background-color: var(--card-bg);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Override text-muted everywhere for better visibility */
.text-muted,
small.text-muted,
.small.text-muted {
    color: #a1a1aa !important;
    /* Brighter gray */
}

/* Stat card labels */
.card small.text-muted,
.card .text-muted,
.card-body small.text-muted,
.card-body .text-muted {
    color: #a1a1aa !important;
}

/* Card header text */
.card-header span,
.card-header {
    color: #e5e7eb !important;
}

/* Default text color for spans and paragraphs */
.card-body span,
.card-body p,
span.small,
.small {
    color: #d1d5db;
}

/* Badge text colors - ensure readability */
.badge.bg-success {
    background-color: #22c55e !important;
    color: #fff !important;
}

.badge.bg-info {
    background-color: #0ea5e9 !important;
    color: #fff !important;
}

/* Form text helper */
.form-text,
.form-text.text-muted {
    color: #9ca3af !important;
}

/* All small text should be visible */
small,
.small {
    color: #d1d5db !important;
}

/* Strong text in small elements */
small strong,
.small strong,
span strong {
    color: #f3f4f6 !important;
}