/* Custom CSS for Scout Portal */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

.min-vh-100 {
    min-height: 100vh;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    text-align: center;
    color: white;
}

/* Card Animations */
.card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.request-type-card {
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.request-type-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 123, 255, 0.15);
}

/* Form Styles */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid:focus,
.form-select.is-valid:focus {
    border-color: var(--success-color);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* File Upload Styles */
.file-drop-zone {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: #fafafa;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: var(--primary-color);
    background-color: rgba(0, 123, 255, 0.05);
}

.file-drop-zone.dragover {
    transform: scale(1.02);
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    background-color: white;
}

.file-item:hover {
    background-color: #f8f9fa;
}

.file-info {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.file-icon {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.file-details {
    flex-grow: 1;
}

.file-name {
    font-weight: 500;
    margin-bottom: 0;
}

.file-size {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-bottom: 0;
}

.file-remove {
    color: var(--danger-color);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.file-remove:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

/* Progress Indicator */
.progress-indicator {
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.progress-bar-custom {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color));
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* Conditional Fields */
.conditional-field {
    border-left: 3px solid var(--primary-color);
    padding-left: 1rem;
    margin-left: 1rem;
    background-color: rgba(0, 123, 255, 0.05);
    border-radius: 0 4px 4px 0;
    transition: all 0.3s ease;
}

.conditional-field.hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Field Progress */
.field-progress-item {
    display: flex;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.875rem;
}

.field-progress-icon {
    margin-right: 0.5rem;
    width: 1rem;
    text-align: center;
}

.field-progress-item.completed .field-progress-icon {
    color: var(--success-color);
}

.field-progress-item.incomplete .field-progress-icon {
    color: var(--secondary-color);
}

.field-progress-item.required.incomplete .field-progress-icon {
    color: var(--danger-color);
}

/* Autosave Indicator */
.autosave-indicator {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1050;
}

.alert-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Toast Styles */
.toast {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.toast-success {
    background-color: var(--success-color);
    color: white;
}

.toast-error {
    background-color: var(--danger-color);
    color: white;
}

.toast-warning {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.toast-info {
    background-color: var(--info-color);
    color: white;
}

/* Button Styles */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, var(--primary-color));
    transform: translateY(-1px);
}

/* Navigation */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .file-drop-zone {
        padding: 1.5rem;
    }
    
    .conditional-field {
        margin-left: 0;
        border-left: none;
        border-top: 3px solid var(--primary-color);
        padding-left: 0;
        padding-top: 1rem;
    }
}

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

/* Focus styles for keyboard navigation */
.btn:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .file-drop-zone {
        border: 2px solid #000;
    }
    
    .btn-outline-primary {
        border: 2px solid var(--primary-color);
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .autosave-indicator,
    .toast-container,
    #loadingOverlay {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
    
    .container {
        max-width: none !important;
        padding: 0 !important;
    }
}

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

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

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

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

/* Utility classes */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.border-left-primary {
    border-left: 3px solid var(--primary-color) !important;
}

.bg-light-primary {
    background-color: rgba(0, 123, 255, 0.05) !important;
}
