/* CSS Variables */
#app {
    --primary-color: #1a73e8;
    --primary-hover: #1557b0;
    --secondary-color: #5f6368;
    --success-color: #34a853;
    --warning-color: #fbbc04;
    --danger-color: #ea4335;
    --info-color: #4285f4;

    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #dadce0;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-muted: #80868b;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --transition: all 0.2s ease;
}

/* Reset & Base */
#app *,
#app *::before,
#app *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

#app {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-color);
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* SVG Icons */
#app .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    vertical-align: middle;
}

#app .icon svg {
    width: 100%;
    height: 100%;
}

#app .icon-sm { font-size: 14px; }
#app .icon-md { font-size: 18px; }
#app .icon-lg { font-size: 24px; }
#app .icon-xl { font-size: 32px; }

/* Header */
#app .app-header {
    background: var(--card-bg);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

#app .app-header h1 {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

#app .app-header h1 .icon {
    color: var(--primary-color);
    font-size: 24px;
}

#app .header-title-wrapper {
    display: flex;
    align-items: center;
}

#app .plan-badge {
    transition: all 0.2s ease;
}

#app .plan-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

#app .plan-badge-pro {
    background: linear-gradient(135deg, #f5af19 0%, #f12711 100%) !important;
    box-shadow: 0 2px 4px rgba(241, 39, 17, 0.3) !important;
}

#app .header-actions {
    display: flex;
    gap: 12px;
}

/* Buttons - prefixed with geox- to avoid Geotab CSS conflicts */
/* Using !important to ensure our styles override Geotab's button styles */
#app .geox-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 6px !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;
    line-height: 1.4 !important;
    min-height: 36px !important;
    white-space: nowrap !important;
}

#app .geox-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

#app .geox-btn-primary {
    background: #1a73e8 !important;
    color: white !important;
    border: none !important;
}

#app .geox-btn-primary:hover:not(:disabled) {
    background: #1557b0 !important;
}

#app .geox-btn-secondary {
    background: #5f6368 !important;
    color: white !important;
    border: none !important;
}

#app .geox-btn-secondary:hover:not(:disabled) {
    background: #4a4d51 !important;
}

#app .geox-btn-outline {
    background: transparent !important;
    color: #202124 !important;
    border: 1px solid #dadce0 !important;
}

#app .geox-btn-outline:hover:not(:disabled) {
    background: #f8f9fa !important;
}

#app .geox-btn-danger {
    background: #ea4335 !important;
    color: white !important;
    border: none !important;
}

#app .geox-btn-danger:hover:not(:disabled) {
    background: #c5221f !important;
}

#app .geox-btn-icon {
    padding: 8px !important;
    min-width: 36px !important;
    background: transparent !important;
    border: 1px solid #dadce0 !important;
}

#app .geox-btn-icon:hover:not(:disabled) {
    background: #f8f9fa !important;
}

#app .geox-btn-icon.active {
    background: #1a73e8 !important;
    color: white !important;
    border-color: #1a73e8 !important;
}

#app .geox-btn-close {
    background: none !important;
    border: none !important;
    font-size: 24px !important;
    color: #5f6368 !important;
    cursor: pointer !important;
    padding: 4px !important;
    line-height: 1 !important;
}

#app .geox-btn-close:hover {
    color: #202124 !important;
}

/* Main Content */
#app .app-content {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Filters Section */
#app .filters-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 24px;
}

#app .filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
}

#app .filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Form Controls */
#app .form-control {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text-primary);
    transition: var(--transition);
    min-width: 150px;
}

#app .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

#app .form-control:disabled {
    background: var(--bg-color);
    cursor: not-allowed;
}

#app .form-control.error,
#app .form-control.has-error {
    border-color: var(--danger-color);
    background-color: #fff5f5;
}

#app .form-control.error:focus,
#app .form-control.has-error:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 2px rgba(234, 67, 53, 0.2);
}

#app .form-group.has-error label {
    color: var(--danger-color);
}

#app select.form-control {
    cursor: pointer;
}

#app textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Statistics Section */
#app .stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

#app .stat-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-align: center;
    border-left: 4px solid var(--primary-color);
    position: relative;
}

#app .stat-card .stat-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 20px;
    opacity: 0.3;
}

#app .stat-card.stat-open .stat-icon { color: var(--danger-color); }
#app .stat-card.stat-investigating .stat-icon { color: var(--warning-color); }
#app .stat-card.stat-resolved .stat-icon { color: var(--success-color); }
#app .stat-card.stat-damage .stat-icon { color: #ff9800; }
#app .stat-card.stat-claims .stat-icon { color: #9c27b0; }

#app .stat-card.stat-open {
    border-left-color: var(--danger-color);
}

#app .stat-card.stat-investigating {
    border-left-color: var(--warning-color);
}

#app .stat-card.stat-resolved {
    border-left-color: var(--success-color);
}

#app .stat-card.stat-damage {
    border-left-color: #ff9800;
}

#app .stat-card.stat-claims {
    border-left-color: #9c27b0;
}

#app .stat-value.stat-currency {
    font-size: 24px;
}

#app .stat-value {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
}

#app .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Accidents Section */
#app .accidents-section {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

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

#app .section-header h2 {
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

#app .section-header h2 .icon {
    color: var(--text-secondary);
}

#app .view-toggle {
    display: flex;
    gap: 4px;
}

/* Accidents List */
#app .accidents-list {
    min-height: 200px;
}

#app .accidents-list.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    padding: 16px;
}

#app .loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: var(--text-secondary);
}

#app .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

#app .empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

#app .empty-state-text {
    font-size: 16px;
    margin-bottom: 8px;
}

#app .empty-state-subtext {
    font-size: 13px;
    color: var(--text-muted);
}

/* Accident Card */
#app .accident-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--primary-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}

#app .accident-card:hover {
    border-color: var(--primary-color);
    background: #f8faff;
    box-shadow: var(--shadow-sm);
}

#app .accident-card:last-child {
    margin-bottom: 0;
}

#app .grid-view .accident-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

#app .accident-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

#app .accident-card-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

#app .accident-card-ref {
    font-size: 10px;
    color: var(--text-muted);
    font-family: monospace;
    margin-left: 8px;
}

#app .accident-card-driver {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 12px;
}

#app .accident-card-date {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

#app .accident-card-body {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#app .accident-card-info {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

#app .accident-card-info .info-label {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
}

#app .accident-card-description {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

#app .accident-card-footer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
}

/* Status Badge */
#app .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    border-radius: 12px;
}

#app .status-badge.status-open {
    background: #fce8e6;
    color: var(--danger-color);
}

#app .status-badge.status-investigating {
    background: #fef7e0;
    color: #b36a00;
}

#app .status-badge.status-resolved {
    background: #e6f4ea;
    color: var(--success-color);
}

#app .status-badge.status-closed {
    background: #e8eaed;
    color: var(--text-secondary);
}

/* Status Select Dropdown */
#app .status-select {
    padding: 4px 24px 4px 10px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}

#app .status-select:hover {
    opacity: 0.85;
}

#app .status-select.status-open {
    background-color: #fce8e6;
    color: var(--danger-color);
}

#app .status-select.status-investigating {
    background-color: #fef7e0;
    color: #b36a00;
}

#app .status-select.status-resolved {
    background-color: #e6f4ea;
    color: var(--success-color);
}

#app .status-select.status-closed {
    background-color: #e8eaed;
    color: var(--text-secondary);
}

/* Severity Badge */
#app .severity-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
}

#app .severity-badge.severity-minor {
    background: #e6f4ea;
    color: var(--success-color);
}

#app .severity-badge.severity-moderate {
    background: #fef7e0;
    color: #b36a00;
}

#app .severity-badge.severity-major {
    background: #fce8e6;
    color: var(--danger-color);
}

#app .severity-badge.severity-severe {
    background: var(--danger-color);
    color: white;
}

/* Modal */
#app .modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}

#app .modal.hidden {
    display: none;
}

#app .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

#app .modal-content {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 800px;
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
}

#app .modal-content.modal-small {
    max-width: 400px;
}

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

#app .modal-header h2 {
    font-size: 18px;
    font-weight: 500;
}

#app .modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

#app .modal-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    padding: 16px 24px !important;
    border-top: 1px solid #dadce0 !important;
}

#app .modal-footer-left {
    flex-shrink: 0 !important;
}

#app .modal-footer-center {
    display: flex !important;
    gap: 16px !important;
    align-items: center !important;
    margin-left: auto !important;
}

/* Ensure consistent button heights in modal footer */
#app .modal-footer .geox-btn {
    height: 40px !important;
    box-sizing: border-box !important;
}

/* Delete button - show as inline-flex when not hidden */
#app #btnDeleteAccident:not(.hidden) {
    display: inline-flex !important;
}

/* Form Sections */
#app .form-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

#app .form-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

#app .form-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

#app .form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

#app .form-row:last-child {
    margin-bottom: 0;
}

#app .form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#app .form-group.full-width {
    flex: 100%;
}

#app .form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

#app .form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

#app .form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Toast Notifications */
#app .toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#app .toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#app .toast-icon {
    font-size: 20px;
}

#app .toast-success .toast-icon {
    color: var(--success-color);
}

#app .toast-error .toast-icon {
    color: var(--danger-color);
}

#app .toast-warning .toast-icon {
    color: var(--warning-color);
}

#app .toast-info .toast-icon {
    color: var(--info-color);
}

#app .toast-message {
    flex: 1;
    font-size: 14px;
}

#app .toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
}

/* Utility Classes */
#app .hidden {
    display: none !important;
}

#app .text-center {
    text-align: center;
}

#app .text-muted {
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    #app .app-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    #app .filters-section {
        flex-direction: column;
    }

    #app .filter-group {
        width: 100%;
    }

    #app .form-control {
        width: 100%;
        min-width: auto;
    }

    #app .form-row {
        flex-direction: column;
    }

    #app .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }

    #app .modal-content {
        margin: 20px;
    }

    #app .accident-card-body {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    #app .stats-section {
        grid-template-columns: 1fr;
    }

    #app .app-content {
        padding: 16px;
    }
}

/* Modal Sizes */
#app .modal-content.modal-large {
    max-width: 900px;
}

#app .modal-content.modal-image {
    max-width: 90vw;
    max-height: 90vh;
    background: transparent;
    box-shadow: none;
}

#app .modal-content.modal-image img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-md);
}

#app .modal-content.modal-image .geox-btn-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 32px;
}

/* Tab Navigation */
#app .tab-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    gap: 4px;
}

#app .tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

#app .tab-btn .icon {
    font-size: 16px;
}

#app .tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-color);
}

#app .tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

#app .tab-content {
    min-height: 400px;
}

#app .tab-pane {
    display: none;
}

#app .tab-pane.active {
    display: block;
}

/* Upload Area */
#app .upload-area {
    margin-bottom: 20px;
}

#app .upload-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-color);
}

#app .upload-dropzone:hover,
#app .upload-dropzone.drag-over {
    border-color: var(--primary-color);
    background: rgba(26, 115, 232, 0.05);
}

#app .upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

#app .upload-dropzone p {
    margin: 8px 0;
    color: var(--text-secondary);
}

#app .upload-hint {
    font-size: 12px;
    color: var(--text-muted);
}

#app .upload-dropzone .geox-btn {
    margin-top: 12px;
}

/* Upload Progress */
#app .upload-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

#app .progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

#app .progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
    animation: progress-pulse 1.5s infinite;
}

@keyframes progress-pulse {
    0%, 100% { width: 30%; margin-left: 0; }
    50% { width: 50%; margin-left: 50%; }
}

#app .progress-text {
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 80px;
}

/* File Gallery (Photos) */
#app .file-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

#app .gallery-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--card-bg);
}

#app .gallery-thumb {
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-color);
}

#app .gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

#app .gallery-thumb:hover img {
    transform: scale(1.05);
}

/* Video thumbnail wrapper */
#app .video-thumb-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

#app .video-thumb-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#app .video-poster {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

#app .video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease;
}

#app .gallery-thumb:hover .video-play-overlay {
    background: rgba(0, 0, 0, 0.5);
}

#app .video-play-overlay svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transition: transform 0.2s ease;
}

#app .gallery-thumb:hover .video-play-overlay svg {
    transform: scale(1.1);
}

/* Video thumbnail hover - match image behavior */
#app .gallery-thumb:hover video {
    transform: scale(1.05);
}

#app .video-thumb-wrapper video {
    transition: transform 0.3s ease;
}

/* Image error placeholder */
#app .image-error-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 100px;
    background: var(--bg-color);
    color: var(--text-muted);
    gap: 8px;
    padding: 16px;
    text-align: center;
}

#app .image-error-placeholder span {
    font-size: 11px;
    opacity: 0.8;
}

/* Preview modal video styling */
#app .modal-content.modal-image video {
    border-radius: var(--radius-md);
    background: #000;
}

/* Video container with loading state */
#app .video-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 300px;
    min-height: 200px;
    background: #000;
    border-radius: var(--radius-md);
}

#app .video-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    z-index: 5;
    gap: 12px;
    font-size: 14px;
}

#app .video-loading.hidden {
    display: none;
}

#app .video-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: video-spin 1s linear infinite;
}

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

#app .video-container video {
    display: block;
    max-width: 90vw;
    max-height: 80vh;
    border-radius: var(--radius-md);
}

#app .gallery-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-top: 1px solid var(--border-color);
}

#app .gallery-name {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#app .btn-delete,
#app .geox-btn-delete {
    background: none;
    border: none;
    color: var(--danger-color);
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    line-height: 1;
}

#app .btn-delete:hover,
#app .geox-btn-delete:hover {
    background: rgba(234, 67, 53, 0.1);
}

/* File List */
#app .file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#app .file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
}

#app .file-icon {
    font-size: 24px;
}

#app .file-info {
    flex: 1;
    min-width: 0;
}

#app .file-name {
    display: block;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#app .file-size {
    font-size: 12px;
    color: var(--text-muted);
}

#app .file-actions {
    display: flex;
    gap: 4px;
}

#app .file-actions .geox-btn-icon {
    padding: 6px;
    min-width: 32px;
    font-size: 14px;
}

/* Empty Message */
#app .empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-style: italic;
}

/* Loading Message */
#app .loading-message {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#app .loading-message .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Pending File Styles */
#app .gallery-item.pending,
#app .file-item.pending {
    border-color: #ffc107;
    background: rgba(255, 193, 7, 0.05);
}

#app .gallery-thumb {
    position: relative;
}

#app .pending-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ffc107;
    color: #000;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

#app .pending-label {
    display: block;
    font-size: 11px;
    color: #ffc107;
    font-weight: 500;
    margin-top: 2px;
}

/* Pending Delete Styles */
#app .gallery-item.pending-delete,
#app .file-item.pending-delete {
    border-color: var(--danger-color);
    background: rgba(234, 67, 53, 0.08);
    opacity: 0.7;
    position: relative;
}

#app .gallery-item.pending-delete img {
    filter: grayscale(50%);
}

#app .delete-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--danger-color);
    color: white;
    font-size: 11px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
}

#app .delete-badge .undo-btn {
    background: white;
    color: var(--danger-color);
    border: none;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
}

#app .delete-badge .undo-btn:hover {
    background: #f5f5f5;
}

/* Action Buttons (Download/Delete) */
#app .btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

#app .btn-action:hover {
    background: var(--bg-color);
}

#app .btn-action svg {
    flex-shrink: 0;
}

#app .btn-download:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(26, 115, 232, 0.08);
}

#app .btn-remove:hover,
#app .btn-remove-small:hover {
    border-color: var(--danger-color);
    color: var(--danger-color);
    background: rgba(234, 67, 53, 0.08);
}

#app .btn-remove-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

/* Input with Button */
#app .input-with-button {
    display: flex;
    gap: 8px;
}

#app .input-with-button .form-control {
    flex: 1;
}

#app .input-with-button .geox-btn {
    flex-shrink: 0;
}

#app .geox-btn-sm {
    padding: 6px 12px !important;
    font-size: 12px !important;
    min-height: 30px !important;
}

/* Form Hints */
#app .form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Geotab Data Fetch Section */
#app .geotab-data-row {
    background: rgba(26, 115, 232, 0.05);
    padding: 16px;
    border-radius: var(--radius-md);
    margin: -8px 0 8px 0;
    border: 1px dashed var(--primary-color);
}

#app .geotab-hint {
    color: var(--primary-color);
    font-style: italic;
}

#app .geotab-hint.hint-updated {
    color: var(--success-color);
    font-weight: 500;
}

#app #fetchDataButtonsRow {
    margin-top: 8px;
}

#app #fetchDataButtonsRow .geox-btn {
    width: 100%;
}

#app .geox-btn-fetch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#app .geox-btn-fetch .icon {
    font-size: 16px;
}

/* Loading state for buttons */
#app .geox-btn.loading {
    position: relative;
    color: transparent;
}

#app .geox-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* DateTime Picker Wrapper */
#app .datetime-picker-wrapper {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
}

#app .datetime-picker-wrapper .datetime-display {
    flex: 1 !important;
    cursor: pointer !important;
    padding-right: 40px !important;
    background: white !important;
}

#app .datetime-picker-wrapper .datetime-display:hover {
    border-color: #1a73e8 !important;
}

#app .datetime-picker-wrapper .datetime-hidden {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    cursor: pointer !important;
    z-index: 2 !important;
}

#app .datetime-icon {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 16px !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

/* Responsive for tabs and uploads */
@media (max-width: 768px) {
    #app .tab-nav {
        flex-wrap: wrap;
    }

    #app .tab-btn {
        flex: 1;
        min-width: 100px;
        text-align: center;
    }

    #app .file-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}
