/* Oztech Drones Custom Styles */

:root {
    /* Agricultural/Natural Color Palette inspired by logo */
    --primary-color: #2d5016;        /* Deep forest green */
    --primary-light: #4a7c59;        /* Lighter green */
    --secondary-color: #8b7355;       /* Warm brown/tan */
    --accent-color: #d4a574;          /* Golden wheat */
    --success-color: #16a34a;         /* Keep green for success */
    --warning-color: #d97706;         /* Keep orange for warnings */
    --danger-color: #dc2626;          /* Keep red for errors */
    --info-color: #0891b2;            /* Keep blue for info */
    --dark-color: #1a1f16;            /* Dark green-brown */
    --light-color: #f7f8f4;           /* Warm off-white */
    --border-radius: 0.5rem;
    --box-shadow: 0 1px 3px 0 rgba(45, 80, 22, 0.1), 0 1px 2px 0 rgba(45, 80, 22, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(45, 80, 22, 0.1), 0 4px 6px -2px rgba(45, 80, 22, 0.05);
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #f8fafc;
    line-height: 1.6;
    min-height: 100vh;
}

/* Custom Card Styles */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.2s ease-in-out;
    background-color: #ffffff;
}

.card:hover {
    box-shadow: var(--box-shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    border-bottom: 1px solid rgba(139, 115, 85, 0.2);
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    font-weight: 600;
}

.card-header.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%) !important;
    color: white;
}

/* Navbar Customization */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-logo {
    height: 40px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    filter: brightness(1.2) contrast(1.1);
}

/* Digital Matrix Header Background */
.navbar-digital-bg {
    background-color: #ffffff;
    background-image: url('/static/header-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.navbar-digital-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 1;
}

.navbar-digital-bg .container-fluid {
    position: relative;
    z-index: 2;
}

.navbar-digital-bg .navbar-nav .nav-link {
    color: #000000 !important;
    font-weight: 500;
}

.navbar-digital-bg .navbar-brand {
    color: #d4a574 !important;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
}

.navbar-text-brand {
    color: #d4a574 !important;
    font-weight: 700;
    font-size: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.landing-logo {
    height: 108px;
    width: auto;
    max-width: 360px;
    object-fit: contain;
    filter: brightness(1.2) contrast(1.1);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .landing-logo {
        height: 72px;
        max-width: 252px;
    }
}

/* Custom navbar styling for new color scheme */
.navbar {
    box-shadow: 0 2px 4px rgba(45, 80, 22, 0.1);
}

.navbar-nav .nav-link:hover {
    color: var(--accent-color) !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.2s ease;
}

.navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Fix dropdown toggle visibility - keep user name black */
.navbar-digital-bg .navbar-nav .dropdown-toggle {
    color: #000000 !important;
}

.navbar-digital-bg .navbar-nav .dropdown-toggle:hover,
.navbar-digital-bg .navbar-nav .dropdown-toggle:focus,
.navbar-digital-bg .navbar-nav .dropdown-toggle.show {
    color: #000000 !important;
    background-color: transparent !important;
}

.navbar-digital-bg .navbar-nav .dropdown-toggle:active {
    color: #000000 !important;
}

/* Button Enhancements */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--box-shadow);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn-info {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

/* Form Enhancements */
.form-control {
    border-radius: var(--border-radius);
    border: 2px solid #333333 !important;
    transition: all 0.2s ease;
    color: #000000 !important;
    background-color: #ffffff !important;
    font-size: 16px !important;
}

.form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(45, 80, 22, 0.25) !important;
    color: #000000 !important;
    background-color: #ffffff !important;
}

.form-control::placeholder {
    color: #666666 !important;
    opacity: 0.8;
}

.form-label {
    font-weight: bold !important;
    color: #000000 !important;
    margin-bottom: 0.5rem;
    font-size: 16px !important;
    display: block !important;
}

/* Additional form label overrides for maximum visibility */
label.form-label,
.form-label,
label {
    color: #000000 !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    display: block !important;
    margin-bottom: 0.5rem !important;
}

.text-dark {
    color: #000000 !important;
}

.fw-bold {
    font-weight: 700 !important;
}

/* Specific form label overrides for equipment and maintenance forms */
.card-body .form-label,
.card-body label,
form .form-label,
form label {
    color: #000000 !important;
    font-weight: 700 !important;
    background-color: transparent !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

/* Auth pages and card styling */
.card {
    background-color: #ffffff !important;
}

.card-body {
    background-color: #ffffff !important;
    color: #000000 !important;
}

.card-title {
    color: #000000 !important;
}

.card-body p {
    color: #000000 !important;
}

.card-body .text-muted {
    color: #555555 !important;
}

/* Additional form styling for better visibility */
textarea.form-control {
    color: #000000 !important;
    background-color: #ffffff !important;
    border: 2px solid #333333 !important;
    font-size: 16px !important;
}

input[type="file"].form-control {
    color: #000000 !important;
    background-color: #ffffff !important;
    border: 2px solid #333333 !important;
    font-size: 16px !important;
}

/* Alert Enhancements - White background with black text for legibility */
.alert {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow);
    background-color: #ffffff !important;
    color: #000000 !important;
    font-weight: 500 !important;
    padding: 1rem !important;
}

.alert * {
    color: #000000 !important;
}

.alert-danger {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #dc2626 !important;
    border-left: 6px solid #dc2626 !important;
}

.alert-success {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #16a34a !important;
    border-left: 6px solid #16a34a !important;
}

.alert-warning {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #d97706 !important;
    border-left: 6px solid #d97706 !important;
}

.alert-info {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #0891b2 !important;
    border-left: 6px solid #0891b2 !important;
}

/* Toast notifications styling */
.toast-custom {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #6b7280 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

.toast-custom * {
    color: #000000 !important;
}

/* Flash message container */
.flash-messages .alert {
    background-color: #ffffff !important;
    color: #000000 !important;
    margin-bottom: 1rem !important;
}

/* Badge Enhancements */
.badge {
    font-weight: 500;
    border-radius: var(--border-radius);
}

/* Dashboard Card Hover Effects */
.dashboard-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

/* Profile Picture Styles */
.profile-picture {
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: var(--box-shadow);
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color), var(--info-color));
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.25rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: var(--box-shadow);
}

/* Media Gallery Styles */
.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.media-item {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: all 0.2s ease;
}

.media-item:hover {
    transform: scale(1.02);
    box-shadow: var(--box-shadow-lg);
}

/* Statistics Cards */
.stat-card {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border-left: 4px solid var(--primary-color);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

/* Forum Post Styles */
.forum-post {
    transition: all 0.2s ease;
}

.forum-post:hover {
    background-color: rgba(37, 99, 235, 0.02);
}

/* Incident Status Colors */
.incident-open {
    border-left: 4px solid #dc2626;
}

.incident-investigating {
    border-left: 4px solid #d97706;
}

.incident-resolved {
    border-left: 4px solid #16a34a;
}

/* Equipment Card Styles */
.equipment-card {
    position: relative;
    overflow: hidden;
}

.equipment-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color));
}

/* Chemical Calculator Styles */
.calculator-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 1rem 0;
}

.calculation-result {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border-left: 4px solid var(--success-color);
}

/* Maintenance Log Styles */
.maintenance-entry {
    border-left: 4px solid var(--info-color);
    background: linear-gradient(135deg, #f0f9ff 0%, rgba(240, 249, 255, 0.3) 100%);
}

/* Loading Spinner */
.spinner-custom {
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(37, 99, 235, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive Utilities */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .timeline {
        padding-left: 1.5rem;
    }
    
    .timeline::before {
        left: 0.75rem;
    }
    
    .timeline-item::before {
        left: -1.75rem;
    }
}

/* PWA Install Banner */
#install-banner {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

/* Dropdown Item Forms */
.dropdown-item-form {
    margin: 0;
    padding: 0;
}

.dropdown-item-form .dropdown-item {
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item-form .dropdown-item:hover {
    background-color: var(--bs-dropdown-link-hover-bg);
    color: var(--bs-dropdown-link-hover-color);
}

/* Enhanced Dropdown Menu Items - Better Touch Feedback */
.dropdown-menu .dropdown-item,
.navbar .dropdown-item {
    position: relative;
    transition: all 0.15s ease;
    padding: 0.6rem 1rem;
}

.dropdown-menu .dropdown-item:hover,
.navbar .dropdown-item:hover {
    background-color: rgba(245, 158, 11, 0.15);
    color: #000;
}

.dropdown-menu .dropdown-item:active,
.navbar .dropdown-item:active,
.dropdown-menu .dropdown-item.tapped,
.navbar .dropdown-item.tapped {
    background-color: rgba(245, 158, 11, 0.4) !important;
    transform: scale(0.98);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Ripple effect for dropdown items */
.dropdown-item-ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(245, 158, 11, 0.5);
    transform: scale(0);
    animation: ripple-effect 0.4s ease-out;
    pointer-events: none;
}

@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Nav link active states for hamburger menu */
.navbar-nav .nav-link:active,
.navbar-nav .nav-link.tapped {
    background-color: rgba(245, 158, 11, 0.3) !important;
    border-radius: 0.375rem;
}

/* Content Formatting */
.content {
    line-height: 1.7;
}

.content p {
    margin-bottom: 1rem;
}

/* Admin Styles */
.admin-section {
    border-left: 4px solid var(--warning-color);
    background: linear-gradient(135deg, #fefcbf 0%, rgba(254, 252, 191, 0.3) 100%);
}

/* User Avatar Placeholder */
.avatar-placeholder {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--dark-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

/* Search Results */
.search-result-item {
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background-color: rgba(37, 99, 235, 0.05);
    transform: translateX(4px);
}

/* Print Styles */
@media print {
    .btn,
    .navbar,
    .card-footer,
    .dropdown,
    #install-banner {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    body {
        background: white;
    }
    
    .alert {
        border: 1px solid #dee2e6;
        background: white !important;
        color: black !important;
    }
}

/* Dark mode support (disabled for better readability) */
/* @media (prefers-color-scheme: dark) {
    :root {
        --light-color: #1e293b;
        --dark-color: #f8fafc;
    }
} */

/* Focus visible for accessibility */
.btn:focus-visible,
.form-control:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Additional agricultural theme styling */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(45, 80, 22, 0.25);
}

.form-label {
    color: var(--dark-color);
    font-weight: 500;
}

.alert-success {
    background-color: rgba(22, 163, 74, 0.1);
    border-color: var(--success-color);
    color: #0f5132;
}

.badge.bg-primary {
    background-color: var(--primary-color) !important;
}

.badge.bg-secondary {
    background-color: var(--secondary-color) !important;
}

/* Custom Image Viewer Overlay */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.image-viewer-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.image-viewer-container {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    flex-direction: column;
    z-index: 10000;
}

.image-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 0.5rem 0.5rem 0 0;
}

.image-counter {
    font-size: 0.9rem;
    font-weight: 500;
}

.image-viewer-controls {
    display: flex;
    gap: 0.5rem;
}

.image-viewer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 0 0 0.5rem 0.5rem;
    padding: 1rem;
}

.image-viewer-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 0.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .image-viewer-container {
        max-width: 98%;
        max-height: 98%;
    }
    
    .image-viewer-header {
        padding: 0.75rem;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .image-viewer-controls {
        justify-content: center;
    }
    
    .image-viewer-content img {
        max-height: 60vh;
    }
}

/* PWA Standalone Mode Enhancements */
.pwa-standalone body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.pwa-standalone .navbar {
    padding-top: calc(env(safe-area-inset-top) + 0.5rem);
}

/* Hide elements that don't make sense in standalone mode */
/* Removed PWA text from header - not needed in display */

/* Better touch targets for mobile */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .card {
        border-radius: var(--border-radius);
        margin-bottom: 1rem;
    }
}

/* Splash screen simulation */
.pwa-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.pwa-splash.hide {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* New Stat Tiles - Simple and Guaranteed Centering */
.stat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    max-width: 320px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    transition: all 0.3s ease;
    cursor: pointer;
    color: white;
    text-decoration: none;
    padding: 2rem;
}

.stat-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
}

.stat-tile i {
    font-size: 3rem;
    color: white;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.stat-tile .stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-tile .stat-label {
    font-size: 1.2rem;
    font-weight: 500;
    color: white;
    opacity: 0.95;
    text-align: center;
}

/* Ensure link styling doesn't interfere */
a .stat-tile {
    color: white !important;
    text-decoration: none !important;
}

a:hover .stat-tile {
    color: white !important;
    text-decoration: none !important;
}

/* Modal and Form Styles - Force all text to be black */
.modal-content {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    background-color: #ffffff !important;
    color: #000000 !important;
}

.modal-content * {
    color: #000000 !important;
}

.modal-header {
    border-bottom: 1px solid rgba(139, 115, 85, 0.2);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    background-color: #ffffff !important;
    color: #000000 !important;
}

.modal-header * {
    color: #000000 !important;
}

.modal-body {
    background-color: #ffffff !important;
    color: #000000 !important;
}

.modal-body * {
    color: #000000 !important;
}

.modal-body p {
    color: #000000 !important;
}

.modal-body label {
    color: #000000 !important;
}

.modal-footer {
    border-top: 1px solid rgba(139, 115, 85, 0.2);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    background-color: #ffffff !important;
    color: #000000 !important;
}

.modal-footer * {
    color: #000000 !important;
}

.modal-title {
    color: #000000 !important;
    font-weight: bold !important;
}

.form-control {
    color: #000000 !important;
    background-color: #ffffff !important;
}

.form-control::placeholder {
    color: #666666 !important;
}

/* Form Controls - Report Modal Specific */
.modal .form-check {
    margin-bottom: 0.75rem !important;
    display: block !important;
    padding-left: 1.5rem !important;
    position: relative !important;
}

.modal .form-check-input {
    position: absolute !important;
    top: 0.25rem !important;
    left: 0 !important;
    width: 1rem !important;
    height: 1rem !important;
    margin: 0 !important;
    background-color: #ffffff !important;
    border: 2px solid var(--primary-color) !important;
    border-radius: 50% !important;
    cursor: pointer !important;
}

.modal .form-check-input:checked {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.modal .form-check-input:checked::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 0.375rem !important;
    height: 0.375rem !important;
    background-color: white !important;
    border-radius: 50% !important;
    transform: translate(-50%, -50%) !important;
}

.modal .form-check-label {
    color: #212529 !important;
    font-weight: 500 !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    cursor: pointer !important;
    display: block !important;
    margin-bottom: 0 !important;
    padding-left: 0 !important;
}

.form-label {
    color: var(--dark-color) !important;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: block;
}

/* Enhanced Video Styling */
.video-container {
    border-radius: 0.375rem;
    overflow: hidden;
    background: 
        linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),
        url('/static/images/video-placeholder.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.2s ease;
}

.video-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.video-overlay {
    background: 
        linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),
        url('/static/images/video-placeholder.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 0.375rem;
    opacity: 1;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.video-overlay:hover {
    opacity: 0.9;
}

.video-play-button {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #667eea;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.video-play-button::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    animation: pulse 2s infinite;
}

.video-play-button:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
    color: #764ba2;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
}

.video-play-button i {
    margin-left: 3px; /* Optical centering for play icon */
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.7;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.video-close-btn {
    background: rgba(0, 0, 0, 0.7) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    width: 36px;
    height: 36px;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.video-close-btn:hover {
    background: rgba(220, 53, 69, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.video-close-btn i {
    font-size: 14px;
}

/* Hide overlay when video is playing */
.video-container video:not([paused]) + .video-overlay {
    opacity: 0;
    pointer-events: none;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .video-play-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .video-close-btn {
        width: 32px;
        height: 32px;
    }
    
    .video-close-btn i {
        font-size: 12px;
    }
}

/* ============================================
   LOADING INDICATORS
   ============================================ */

/* Top Progress Bar - Thick and Visible */
#top-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 6px;
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 50%, #fcd34d 100%);
    z-index: 99999 !important;
    transition: width 0.4s ease, opacity 0.3s ease;
    box-shadow: 0 2px 15px rgba(245, 158, 11, 0.8), 0 0 30px rgba(245, 158, 11, 0.4);
    opacity: 1;
    animation: glowing 1.5s ease-in-out infinite;
}

@keyframes glowing {
    0%, 100% {
        box-shadow: 0 2px 15px rgba(245, 158, 11, 0.8), 0 0 30px rgba(245, 158, 11, 0.4);
    }
    50% {
        box-shadow: 0 2px 20px rgba(245, 158, 11, 1), 0 0 40px rgba(245, 158, 11, 0.6);
    }
}

#top-progress-bar.complete {
    width: 100% !important;
    transition: width 0.2s ease;
}

#top-progress-bar.hide {
    opacity: 0;
}

/* Full-page Loading Overlay - More Visible */
#page-loading-overlay {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: blur(8px);
    z-index: 999999 !important;
    justify-content: center;
    align-items: center;
    opacity: 1 !important;
}

#page-loading-overlay.active {
    display: flex !important;
    opacity: 1 !important;
}

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

.loading-spinner-container {
    text-align: center;
    background: rgba(50, 50, 50, 0.95) !important;
    padding: 50px 70px;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    opacity: 1 !important;
}

.loading-spinner {
    width: 100px !important;
    height: 100px !important;
    border: 8px solid rgba(245, 158, 11, 0.3) !important;
    border-top: 8px solid #f59e0b !important;
    border-radius: 50%;
    animation: spin 0.7s linear infinite !important;
    margin: 0 auto 25px;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.7) !important;
    opacity: 1 !important;
}

.loading-text {
    color: #ffffff !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    margin-top: 20px;
    letter-spacing: 1px;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.8);
    opacity: 1 !important;
}

/* Button Spinner (for AJAX actions) */
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

.btn-spinner-dark {
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top: 2px solid #000000;
}

/* Spinner Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pulse Animation for Loading Text */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.loading-text {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Button Loading State */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Prevent double clicks during loading */
.loading-overlay-active {
    pointer-events: none;
    cursor: wait;
}

.loading-overlay-active * {
    pointer-events: none;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    #top-progress-bar {
        height: 5px;
    }
    
    .loading-spinner-container {
        padding: 30px 40px;
    }
    
    .loading-spinner {
        width: 70px;
        height: 70px;
        border-width: 5px;
    }
    
    .loading-text {
        font-size: 16px;
    }
}

/* Weekly Hours Dashboard Card Override - MUST BE LAST TO OVERRIDE GLOBAL CARD STYLES */
.weekly-hours-main-card,
.weekly-hours-main-card.card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.weekly-hours-body,
.weekly-hours-body.card-body {
    background-color: transparent !important;
    color: #ffffff !important;
}

.weekly-hours-card {
    background-color: #1e293b !important;
}

.weekly-hours-card .card-body,
.weekly-hours-card .card-body div,
.weekly-hours-card .card-body p,
.weekly-hours-card .card-body span,
.weekly-hours-card .card-body h1,
.weekly-hours-card .card-body h2,
.weekly-hours-card .card-body h3,
.weekly-hours-card .card-body h4,
.weekly-hours-card .card-body h5,
.weekly-hours-card .card-body h6,
.weekly-hours-card .card-body small {
    color: #ffffff !important;
    background-color: transparent !important;
}

/* Weekly Total Display - White text on gradient background */
.weekly-total-display,
.weekly-total-display *,
.weekly-total-display i,
.weekly-total-display h1,
.weekly-total-display h2,
.weekly-total-display h3,
.weekly-total-display h4,
.weekly-total-display h5,
.weekly-total-display h6,
.weekly-total-display p,
.weekly-total-display small {
    color: #ffffff !important;
    background-color: transparent !important;
}

.weekly-hours-body h5,
.weekly-hours-body .text-white {
    color: #ffffff !important;
}
