:root {
    /* Olive Green Theme Colors */
    --primary: #556B2F;      /* Dark Olive */
    --primary-light: #6B8E23; /* Olive Drab */
    --primary-dark: #3D4F22;  /* Deep Olive */
    --accent: #8FBC8F;        /* Dark Sea Green */
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
}

/* Override Bootstrap Colors */
.bg-primary {
    background-color: var(--primary) !important;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
}

.navbar-dark .navbar-brand {
    color: white;
}

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

.alert-info {
    background-color: rgba(143, 188, 143, 0.2);
    border-color: var(--accent);
    color: var(--primary-dark);
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--light);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* View Management */
.view {
    min-height: 100vh;
    background-color: #f5f5f5;
}

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

.card-header {
    background-color: rgba(85, 107, 47, 0.1);
    border-bottom: 2px solid var(--primary);
}

/* Forms */
.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem rgba(143, 188, 143, 0.25);
}

.input-group-text {
    background-color: rgba(85, 107, 47, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

/* Tables */
.table thead th {
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
}

.table-hover tbody tr:hover {
    background-color: rgba(143, 188, 143, 0.1);
}

/* Buttons */
.btn {
    border-radius: 5px;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.btn i {
    margin-left: 0.5rem;
}

/* QR Code Reader */
#qr-reader {
    border-radius: 10px;
    overflow: hidden;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#qr-reader video {
    border-radius: 10px;
}

/* QR Mode Toggle */
.btn-group .btn {
    transition: all 0.3s ease;
}

.btn-group .btn.active {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Manual QR Input */
#manual-qr-input {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* Camera Container */
#camera-container {
    position: relative;
    background-color: #000;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 4/3;
}

#camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#camera-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* Responsive */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }

    .card-body {
        padding: 1rem;
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* RTL Support */
.rtl {
    direction: rtl;
    text-align: right;
}

.rtl .me-2 {
    margin-right: 0.5rem;
    margin-left: 0;
}

.rtl .ms-2 {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
}

.toast {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
    opacity: 0;
    transform: translateX(-100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* Modal Styles */
.modal-content {
    border-radius: 10px;
    border: none;
}

.modal-header {
    background-color: rgba(85, 107, 47, 0.1);
    border-bottom: 2px solid var(--primary);
}

/* Navigation Tabs */
.nav-tabs .nav-link {
    color: var(--primary);
    border: 1px solid transparent;
}

.nav-tabs .nav-link.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.nav-tabs .nav-link:hover {
    border-color: var(--accent);
}

/* Status Indicators */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-present {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.status-absent {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.status-pending {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--warning);
}

/* Photo Preview */
.photo-preview {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s;
}

.photo-preview:hover {
    transform: scale(1.05);
}

/* Photo Modal */
.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: pointer;
}

.photo-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
}

.photo-modal .close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .nav-tabs,
    .modal {
        display: none !important;
    }

    .container-fluid {
        padding: 0 !important;
    }
}