/**
 * 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;
    position: relative;
    overflow: hidden;
}

/* ===== MECHANIC BACKGROUND ANIMATIONS ===== */
.mechanic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Rotating Gears */
.gear {
    position: absolute;
    border: 4px solid rgba(255, 140, 0, 0.15);
    border-radius: 50%;
    animation: rotate-gear 20s linear infinite;
}

.gear::before,
.gear::after {
    content: '';
    position: absolute;
    background: rgba(255, 140, 0, 0.15);
}

/* Gear teeth */
.gear::before {
    width: 100%;
    height: 12%;
    top: 44%;
    left: 0;
}

.gear::after {
    width: 12%;
    height: 100%;
    top: 0;
    left: 44%;
}

/* Individual gears */
.gear-1 {
    width: 200px;
    height: 200px;
    top: -50px;
    left: -50px;
    animation-duration: 25s;
}

.gear-2 {
    width: 150px;
    height: 150px;
    top: 30%;
    right: -40px;
    animation-duration: 18s;
    animation-direction: reverse;
}

.gear-3 {
    width: 120px;
    height: 120px;
    bottom: 10%;
    left: 5%;
    animation-duration: 22s;
}

.gear-4 {
    width: 180px;
    height: 180px;
    bottom: -60px;
    right: 15%;
    animation-duration: 30s;
    animation-direction: reverse;
}

.gear-5 {
    width: 100px;
    height: 100px;
    top: 20%;
    left: 20%;
    animation-duration: 15s;
}

@keyframes rotate-gear {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Floating Wrenches */
.wrench {
    position: absolute;
    font-size: 2rem;
    color: rgba(255, 140, 0, 0.12);
    animation: float-tool 15s ease-in-out infinite;
}

.wrench-1 {
    top: 15%;
    right: 10%;
    animation-delay: 0s;
}

.wrench-2 {
    bottom: 25%;
    left: 8%;
    animation-delay: 5s;
    font-size: 1.5rem;
}

.wrench-3 {
    top: 60%;
    right: 25%;
    animation-delay: 10s;
    font-size: 1.8rem;
}

@keyframes float-tool {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.12;
    }

    50% {
        transform: translateY(-20px) rotate(15deg);
        opacity: 0.2;
    }
}

/* Spark Particles */
.sparks-container {
    position: absolute;
    bottom: 30%;
    left: 10%;
    width: 100px;
    height: 100px;
}

.spark {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ff6b00;
    border-radius: 50%;
    animation: spark-fly 2s ease-out infinite;
    box-shadow: 0 0 6px #ff6b00, 0 0 12px #ff4500;
}

.spark:nth-child(1) {
    animation-delay: 0s;
    left: 50%;
}

.spark:nth-child(2) {
    animation-delay: 0.2s;
    left: 45%;
}

.spark:nth-child(3) {
    animation-delay: 0.4s;
    left: 55%;
}

.spark:nth-child(4) {
    animation-delay: 0.6s;
    left: 48%;
}

.spark:nth-child(5) {
    animation-delay: 0.8s;
    left: 52%;
}

.spark:nth-child(6) {
    animation-delay: 1s;
    left: 40%;
}

.spark:nth-child(7) {
    animation-delay: 1.2s;
    left: 60%;
}

.spark:nth-child(8) {
    animation-delay: 1.4s;
    left: 46%;
}

@keyframes spark-fly {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-80px) translateX(calc(var(--x, 0) * 1px)) scale(0);
        opacity: 0;
    }
}

.spark:nth-child(1) {
    --x: -20;
}

.spark:nth-child(2) {
    --x: 15;
}

.spark:nth-child(3) {
    --x: -30;
}

.spark:nth-child(4) {
    --x: 25;
}

.spark:nth-child(5) {
    --x: -10;
}

.spark:nth-child(6) {
    --x: 35;
}

.spark:nth-child(7) {
    --x: -25;
}

.spark:nth-child(8) {
    --x: 20;
}

/* Second Sparks Container */
.sparks-container-2 {
    position: absolute;
    top: 40%;
    right: 15%;
    width: 100px;
    height: 100px;
}

/* Piston Animation */
.piston {
    position: absolute;
    width: 30px;
    height: 60px;
    bottom: 15%;
    right: 8%;
    opacity: 0.15;
}

.piston-rod {
    width: 10px;
    height: 40px;
    background: linear-gradient(90deg, #666, #888, #666);
    margin: 0 auto;
    animation: piston-move 1s ease-in-out infinite;
}

.piston-head {
    width: 30px;
    height: 20px;
    background: linear-gradient(180deg, #ff6b00, #cc5500);
    border-radius: 4px 4px 0 0;
    animation: piston-move 1s ease-in-out infinite;
}

@keyframes piston-move {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(15px);
    }
}

/* Ensure portal card is above background */
.portal-card {
    max-width: 400px;
    width: 100%;
    position: relative;
    z-index: 10;
}


.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: #e0e0e0;
}

/* Placeholder text - more visible */
.form-control::placeholder,
.form-select::placeholder {
    color: #888 !important;
    opacity: 1;
}

/* Input text color */
.form-control,
.form-select {
    color: #fff !important;
}

/* Modal form specific - brighter labels */
.modal-body .form-label {
    color: #f0f0f0 !important;
}

/* 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;
}