html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* Стилизация на datepicker за събота и неделя */
input[type="date"] {
  position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
}

/* Стилизация за събота (син цвят) и неделя (червен цвят) в datepicker */
/* Забележка: Нативният datepicker не поддържа директна стилизация на отделни дни */
/* Но можем да добавим визуални индикатори чрез JavaScript */
.datepicker-weekend {
  background-color: #fff3cd !important;
  border-color: #ffc107 !important;
}

.datepicker-saturday {
  background-color: #d1ecf1 !important;
  border-color: #17a2b8 !important;
}

.datepicker-sunday {
  background-color: #f8d7da !important;
  border-color: #dc3545 !important;
}

.footer {
  width: 100%;
  white-space: nowrap;
}

/* Custom styles */
.card {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  border: 1px solid rgba(0, 0, 0, 0.125);
}

/* Navigation fixes */
/* Enhanced Navigation */
.navbar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: all 0.3s ease;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin: 0 0.25rem;
}

.navbar-nav .nav-link:hover {
  background-color: rgba(0, 123, 255, 0.1);
  color: #007bff;
  transform: translateY(-1px);
}

.navbar-nav .nav-link i {
  font-size: 1rem;
  width: 1rem;
  text-align: center;
}

.navbar-nav .dropdown-toggle::after {
  margin-left: 0.5rem;
  transition: transform 0.3s ease;
}

.navbar-nav .dropdown.show .dropdown-toggle::after {
  transform: rotate(180deg);
}

/* Enhanced Dropdown Styling */
.dropdown-menu {
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border: none;
  padding: 0.75rem 0;
  margin-top: 0.5rem;
  animation: dropdownFadeIn 0.3s ease;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  padding: 0.75rem 1.25rem;
  transition: all 0.3s ease;
  color: #495057;
  border-radius: 8px;
  margin: 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dropdown-item:hover {
  background-color: rgba(0, 123, 255, 0.1);
  color: #007bff;
  transform: translateX(5px);
}

.dropdown-item i {
  width: 1.25rem;
  text-align: center;
}

.dropdown-header {
  padding: 0.75rem 1.25rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 8px;
  margin: 0 0.5rem 0.5rem 0.5rem;
}

.card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.table th {
  background-color: #f8f9fa;
  border-top: none;
}

.btn-group .btn {
  margin-right: 0.25rem;
}

.btn-group .btn:last-child {
  margin-right: 0;
}

.alert {
  border-radius: 0.375rem;
}

.badge {
  font-size: 0.75em;
}

/* Improved and consolidated Drag & Drop Upload Styles */
.drag-drop-zone {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.drag-drop-zone:hover,
.drag-drop-zone.drag-over {
    border-color: #007bff;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15);
}

.drag-drop-zone.dragover {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.2);
}

.drag-drop-zone.dragover .drag-drop-text {
    color: #28a745;
    font-weight: 600;
}

.drag-drop-zone input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.drag-drop-zone .upload-icon,
.drag-drop-icon {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.drag-drop-zone:hover .upload-icon,
.drag-drop-zone:hover .drag-drop-icon {
    color: #007bff;
    transform: scale(1.1);
}

.drag-drop-zone .upload-text,
.drag-drop-text {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.drag-drop-zone .upload-hint,
.drag-drop-hint {
    color: #adb5bd;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* File preview and management */
.upload-preview,
.file-preview {
    margin-top: 20px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-item {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.file-item:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
    transform: translateY(-1px);
}

.file-item .file-icon {
    font-size: 1.5rem;
    min-width: 24px;
    text-align: center;
}

.file-item .file-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.file-item .file-name {
    font-weight: 500;
    margin-bottom: 2px;
    word-break: break-word;
    color: #212529;
}

.file-item .file-size,
.file-item .file-meta {
    font-size: 0.8rem;
    color: #6c757d;
}

.file-item .remove-file,
.file-item .btn-action {
    color: #dc3545;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: none;
    border: none;
    font-size: 0.9rem;
}

.file-item .remove-file:hover,
.file-item .btn-action:hover {
    background-color: #f8d7da;
    color: #721c24;
}

/* Upload progress indicators */
.upload-progress {
    margin-top: 15px;
}

.progress-item {
    margin-bottom: 10px;
}

.progress-item .progress {
    height: 8px;
    border-radius: 10px;
    overflow: hidden;
}

.progress-item .progress-text {
    font-size: 0.8rem;
    margin-bottom: 4px;
    font-weight: 500;
}

.upload-success {
    color: #28a745;
    font-weight: 600;
}

.upload-error {
    color: #dc3545;
    font-weight: 600;
}

/* Small variant for compact spaces */
.drag-drop-zone.small {
    padding: 25px 15px;
    min-height: 120px;
}

.drag-drop-zone.small .drag-drop-icon,
.drag-drop-zone.small .upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
}

.drag-drop-zone.small .drag-drop-text,
.drag-drop-zone.small .upload-text {
    font-size: 1rem;
}

.drag-drop-zone.small .drag-drop-hint,
.drag-drop-zone.small .upload-hint {
    font-size: 0.8rem;
}

/* Enhanced File Upload UI Components */
.file-upload-container {
    position: relative;
    margin-bottom: 20px;
}

.file-upload-container .btn-upload {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 123, 255, 0.25);
}

.file-upload-container .btn-upload:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.35);
}

.file-upload-container .btn-upload:active {
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.file-upload-container input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

/* Enhanced Upload Progress Bar */
.upload-progress-bar {
    height: 6px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 12px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.upload-progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff 0%, #28a745 100%);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
    position: relative;
}

.upload-progress-bar .progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* File List Improvements */
.file-list {
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #007bff #f8f9fa;
}

.file-list::-webkit-scrollbar {
    width: 6px;
}

.file-list::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 10px;
}

.file-list::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 10px;
}

.file-list::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    /* Drag & Drop Mobile Optimization */
    .drag-drop-zone {
        padding: 30px 15px;
        min-height: 120px;
        border-radius: 10px;
    }
    
    .drag-drop-zone .upload-icon,
    .drag-drop-zone .drag-drop-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .drag-drop-zone .upload-text,
    .drag-drop-zone .drag-drop-text {
        font-size: 1rem;
    }
    
    .drag-drop-zone .upload-hint,
    .drag-drop-zone .drag-drop-hint {
        font-size: 0.8rem;
    }
    
    /* File Items Mobile Layout */
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
        gap: 8px;
    }
    
    .file-item .file-info {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .file-item .file-actions {
        width: 100%;
        justify-content: flex-end;
        gap: 6px;
    }
    
    /* Button Improvements */
    .btn-upload {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 1rem;
    }
    
    /* Hero Section Mobile */
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 280px;
        margin-bottom: 0;
    }
    
    /* Cards and Modals */
    .modern-card {
        margin-bottom: 1rem;
        padding: 1.2rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Navigation */
    .navbar-nav .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        margin-top: 0;
        background-color: rgba(248, 249, 250, 0.95);
        border-radius: 8px;
    }
    
    /* Action Icons and Quick Actions */
    .quick-action-item {
        padding: 1.5rem 1rem;
        margin-bottom: 1rem;
    }
    
    .action-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    /* Form Controls */
    .modern-form-control {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px 16px;
    }
    
    .form-control:focus {
        font-size: 16px;
    }
    
    /* Tables */
    .table-responsive {
        border-radius: 8px;
        margin-bottom: 1rem;
    }
    
    .modern-table {
        font-size: 0.9rem;
    }
    
    .modern-table thead th {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .modern-table tbody td {
        padding: 0.75rem 0.5rem;
    }
}

/* Extra small devices (phones in portrait, less than 576px) */
@media (max-width: 575.98px) {
    .container-fluid {
        padding-left: 0.8rem;
        padding-right: 0.8rem;
    }
    
    .drag-drop-zone {
        padding: 20px 10px;
        min-height: 100px;
    }
    
    .drag-drop-zone .upload-icon,
    .drag-drop-zone .drag-drop-icon {
        font-size: 2rem;
    }
    
    .hero-section {
        padding: 1.5rem 0.8rem;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .hero-content .lead {
        font-size: 1rem;
    }
    
    .modern-card {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .action-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
}

/* Landscape orientation tweaks */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-section {
        padding: 1rem;
    }
    
    .modal-dialog {
        margin: 0.25rem;
    }
    
    .drag-drop-zone {
        min-height: 80px;
        padding: 15px;
    }
}

/* PWA Offline Indicator */
body.offline::before {
    content: "Няма интернет връзка";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #dc3545;
    color: white;
    text-align: center;
    padding: 8px;
    z-index: 9999;
    font-size: 14px;
}

/* PWA Install Button */
#install-pwa {
    transition: all 0.3s ease;
}

#install-pwa:hover {
    background-color: #007bff;
    color: white;
}

/* PWA Deep Link Styles */
.pwa-deep-link {
    cursor: pointer;
    transition: all 0.3s ease;
}

.pwa-deep-link:hover {
    transform: scale(1.05);
}

/* Modal Animations - COMPLETELY FIXED to prevent flickering */
.modal {
    /* Force proper initial state */
    opacity: 0 !important;
    visibility: hidden !important;
    transition: none !important;
    display: none !important;
}

.modal.show {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.modal.fade .modal-dialog {
    transition: transform 0.2s ease-out !important;
    transform: translate(0, -10px) !important;
}

.modal.show .modal-dialog {
    transform: translate(0, 0) !important;
}

/* Prevent ALL content flickering */
.modal-content {
    /* Remove ALL transitions that could cause flickering */
    transform: none !important;
    transition: none !important;
    animation: none !important;
}

/* Ensure proper backdrop */
.modal-backdrop {
    transition: opacity 0.2s ease !important;
}

/* Fix for modal stacking */
.modal-open {
    overflow: hidden !important;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    padding-right: 0 !important;
}

/* Force proper z-index */
.modal {
    z-index: 1055 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
}

/* Step Details Modal Styles */
#stepDetailsModal .modal-header {
    border-bottom: 2px solid #007bff;
}

#stepDetailsModal .card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

#stepDetailsModal .card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#stepDetailsModal .card-header {
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

#stepDetailsModal .progress {
    border-radius: 10px;
    overflow: hidden;
}

#stepDetailsModal .progress-bar {
    transition: width 0.6s ease;
}

#stepDetailsModal .btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#stepDetailsModal .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Status Badge Animations */
.badge {
    transition: all 0.3s ease;
}

.badge:hover {
    transform: scale(1.05);
}

/* Icon Animations */
#stepDetailsModal .fas {
    transition: all 0.3s ease;
}

#stepDetailsModal .card:hover .fas {
    transform: scale(1.1);
} 

/* === МОДАЛ ЗА ЕТАП 3 === */
.modal-lg { max-width: 800px; }
.invalid-feedback { display: none; color: #dc3545; }
input:invalid ~ .invalid-feedback, textarea:invalid ~ .invalid-feedback { display: block; } 