 :root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
}

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Navigation Styles */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Card Components */
.main-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border: none;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 600;
    padding: 1.5rem;
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, #5dade2 100%);
    border: none;
    border-radius: 10px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #2ecc71 100%);
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c0392b 100%);
    border: none;
    border-radius: 10px;
    padding: 0.5rem 1rem;
}

/* Form Sections */
.units-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.unit-row {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Configuration Notice */
.config-notice {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 2rem;
    color: #0c5460;
}

/* Field Management Link */
.field-management-link {
    background: linear-gradient(135deg, var(--warning-color) 0%, #f1c40f 100%);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: inline-block;
    transition: all 0.3s ease;
}

.field-management-link:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.4);
}

/* Loading States */
.btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Form Validation */
.invalid-feedback {
    display: block;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger-color);
}

/* File Management Styles */
.existing-files-container {
    border: 1px solid #dee2e6;
}

.file-item {
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
}

.file-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.file-preview {
    position: relative;
    overflow: hidden;
}

.file-preview img {
    transition: transform 0.3s ease;
}

.file-item:hover .file-preview img {
    transform: scale(1.05);
}

/* Color classes for file types */
.text-purple {
    color: #6f42c1 !important;
}

/* File delete animation */
.file-item.deleting {
    opacity: 0.5;
    pointer-events: none;
}

/* Toast notifications */
.alert.position-fixed {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
}

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

/* File type colors */
.text-purple {
    color: #6f42c1 !important;
}

.fa-file-pdf {
    color: #e74c3c;
}

.fa-file-word {
    color: #2980b9;
}

.fa-file-excel {
    color: #27ae60;
}

.fa-file-powerpoint {
    color: #e67e22;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .page-header {
        padding: 1.5rem;
    }
    
    .page-header .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .units-section {
        padding: 1rem;
    }
    
    .unit-row {
        padding: 0.75rem;
    }
}