/* ============================================
   SISTEM ABSENSI QR CODE - Styles
   ============================================ */

/* CSS Variables */
:root {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);

    --accent-green: #00d26a;
    --accent-green-glow: rgba(0, 210, 106, 0.3);
    --accent-red: #ff4757;
    --accent-red-glow: rgba(255, 71, 87, 0.3);
    --accent-blue: #3498db;

    --border-color: rgba(255, 255, 255, 0.1);
    --border-radius: 16px;
    --border-radius-sm: 8px;

    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-button: 0 4px 15px rgba(0, 0, 0, 0.2);

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

/* Container */
.container {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Company Branding */
.company-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.company-branding.hidden {
    display: none;
}

.company-logo {
    width: 80px;
    height: 80px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.company-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.logo-placeholder {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 1px;
}

.company-name {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 20px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 1.8rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-time {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Main Card */
.main-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

/* Info Section */
.info-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-item.half {
    flex: 1;
}

.info-row {
    display: flex;
    gap: 16px;
}

.info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.info-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.info-value.small {
    font-size: 0.95rem;
    font-weight: 500;
}

.info-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* Loading dots animation */
.loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%,
    100% {
        content: '...';
    }
}

/* Action Section */
.action-section {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 16px;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-family: var(--font-family);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: var(--transition);
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 2rem;
}

.btn-text {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Button Masuk */
.btn-masuk {
    background: linear-gradient(135deg, rgba(0, 210, 106, 0.2) 0%, rgba(0, 210, 106, 0.1) 100%);
    border: 1px solid rgba(0, 210, 106, 0.3);
    color: var(--accent-green);
    box-shadow: 0 0 20px var(--accent-green-glow);
}

.btn-masuk:hover:not(:disabled):not(.btn-disabled) {
    background: linear-gradient(135deg, rgba(0, 210, 106, 0.3) 0%, rgba(0, 210, 106, 0.15) 100%);
    box-shadow: 0 0 30px var(--accent-green-glow);
}

/* Button Pulang */
.btn-pulang {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.2) 0%, rgba(255, 71, 87, 0.1) 100%);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: var(--accent-red);
    box-shadow: 0 0 20px var(--accent-red-glow);
}

.btn-pulang:hover:not(:disabled):not(.btn-disabled) {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.3) 0%, rgba(255, 71, 87, 0.15) 100%);
    box-shadow: 0 0 30px var(--accent-red-glow);
}

/* Notification */
.notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-card);
    opacity: 0;
    transition: var(--transition);
    z-index: 100;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.notification.success {
    border-color: var(--accent-green);
    box-shadow: 0 0 20px var(--accent-green-glow);
}

.notification.error {
    border-color: var(--accent-red);
    box-shadow: 0 0 20px var(--accent-red-glow);
}

.notification-icon {
    font-size: 1.2rem;
}

.notification-text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 35, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 200;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 8px;
}

.footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 360px) {
    html {
        font-size: 14px;
    }

    .main-card {
        padding: 20px 16px;
    }
}

@media (min-height: 800px) {
    .container {
        gap: 30px;
    }

    .action-section {
        margin-top: 10px;
    }
}

/* GPS Error State */
.gps-error {
    color: var(--accent-red) !important;
    font-size: 0.85rem !important;
}

/* Success animation */
@keyframes successPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.btn.success {
    animation: successPulse 0.3s ease;
}

/* ============================================
   V2 NEW STYLES - Camera, Modal, Riwayat
   ============================================ */

/* Camera Section */
.camera-section {
    margin-bottom: 20px;
}

.btn-camera {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}

.btn-camera:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.photo-preview {
    margin-top: 15px;
    text-align: center;
}

.photo-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 12px;
    border: 2px solid var(--accent-blue);
    object-fit: cover;
}

.btn-retake {
    margin-top: 10px;
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-retake:hover {
    background: var(--bg-card-hover);
}

/* Absen Status */
.absen-status {
    margin-bottom: 15px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.5;
}

.absen-status.info {
    border-left: 4px solid var(--accent-blue);
}

.absen-status.warning {
    border-left: 4px solid #ffa502;
}

.absen-status.success {
    border-left: 4px solid var(--accent-green);
}

/* Riwayat & Izin Buttons */
.riwayat-section {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

.btn-riwayat {
    flex: 1;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--accent-blue);
    border-radius: 8px;
    color: var(--accent-blue);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-riwayat:hover {
    background: rgba(52, 152, 219, 0.1);
}

.btn-izin {
    flex: 1;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid #f39c12;
    border-radius: 8px;
    color: #f39c12;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-izin:hover {
    background: rgba(243, 156, 18, 0.1);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

/* Riwayat Filter */
.riwayat-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.riwayat-filter select {
    flex: 1;
    padding: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Riwayat List */
.riwayat-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.loading-message {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 20px;
}

.riwayat-item {
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.riwayat-item:hover {
    background: var(--bg-card-hover);
}

.riwayat-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.riwayat-time {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--accent-green);
}

.riwayat-time.pulang {
    color: var(--accent-red);
}

.riwayat-time.auto {
    color: #ffa502;
    font-size: 0.85rem;
}

.riwayat-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 30px;
}

/* Disabled button state */
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Visual disable class (extra protection) */
.btn-disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Force gray background when disabled */
.btn:disabled,
.btn-disabled {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.3) !important;
}

/* Specifically override btn-masuk when disabled */
.btn-masuk:disabled,
.btn-masuk.btn-disabled {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: none !important;
}

/* Specifically override btn-pulang when disabled */
.btn-pulang:disabled,
.btn-pulang.btn-disabled {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: none !important;
}

/* Remove hover effects when disabled */
.btn-disabled:hover,
.btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
    background: rgba(255, 255, 255, 0.05) !important;
}