/* ============================================================================
   FORMS - Стили для форм
   ============================================================================ */

.form-field {
    margin-bottom: 1.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #4a6b5c;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.modern-input,
.form-control {
    border: 2px solid #cce3de;
    border-radius: 8px;
    padding: 0.75rem;
    transition: all 0.3s ease;
    background-color: #f6fff8;
}

.modern-input:focus,
.form-control:focus {
    border-color: #a4c3b2;
    box-shadow: 0 0 0 0.2rem rgba(107, 144, 128, 0.15);
    outline: none;
    background-color: #eaf4f4;
}

.modern-input:read-only {
    background-color: #f6fff8;
    cursor: not-allowed;
}

.form-control.modern-input-sm,
input.modern-input-sm {
    border: 2px solid #cce3de !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    background-color: #f6fff8 !important;
    height: 29.19px !important;
    box-sizing: border-box;
}

.form-control.modern-input-sm:focus,
input.modern-input-sm:focus {
    border-color: #a4c3b2 !important;
    box-shadow: 0 0 0 0.2rem rgba(107, 144, 128, 0.15) !important;
    outline: none;
    background-color: #eaf4f4 !important;
}

.form-control.modern-input-sm:read-only,
input.modern-input-sm:read-only {
    background-color: #f6fff8 !important;
    cursor: not-allowed;
}

.description-content {
    border: 2px solid #cce3de;
    border-radius: 8px;
    padding: 0.75rem;
    background-color: #f6fff8;
    min-height: 60px;
    color: var(--viridian);
}

.validation-message {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.form-hint {
    color: #6b9080;
    font-size: 0.875rem;
    margin-top: 1rem;
    display: block;
}

/* ============================================================================
   CHECKBOX - Универсальные стили для чекбоксов
   ============================================================================ */

.form-check-input {
    border: 2px solid #cce3de !important;
    border-radius: 4px !important;
    background-color: #f6fff8 !important;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-check-input:checked {
    background-color: #6b9080 !important;
    border-color: #6b9080 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8l2 2 6-6'/%3e%3c/svg%3e") !important;
    background-size: 100% 100% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

.form-check-input:hover {
    border-color: #a4c3b2 !important;
    box-shadow: 0 0 0 0.2rem rgba(107, 144, 128, 0.15) !important;
}

.form-check-input:focus {
    border-color: #a4c3b2 !important;
    box-shadow: 0 0 0 0.2rem rgba(107, 144, 128, 0.15) !important;
    outline: none !important;
}

/* ============================================================================
   BUTTON GROUP TOGGLE - Стили для переключателей (Да/Нет)
   ============================================================================ */

.btn-group {
    border: 2px solid #cce3de;
    border-radius: 8px;
    overflow: hidden;
    display: inline-flex;
}

.btn-group .btn-check:checked + .btn-outline-primary {
    background-color: #6b9080 !important;
    border-color: #6b9080 !important;
    color: #ffffff !important;
}

.btn-group .btn-outline-primary {
    border: none !important;
    border-radius: 0 !important;
    color: #6b9080 !important;
    background-color: #f6fff8 !important;
    transition: all 0.3s ease;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
}

.btn-group .btn-outline-primary:first-child {
    border-right: 1px solid #cce3de !important;
}

.btn-group .btn-outline-primary:hover {
    background-color: #eaf4f4 !important;
    color: #4a6b5c !important;
}

.btn-group .btn-check:focus + .btn-outline-primary {
    box-shadow: 0 0 0 0.2rem rgba(107, 144, 128, 0.15) !important;
    outline: none !important;
}

.is-invalid {
    border-color: #dc3545 !important;
}

.duplicate-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ============================================================================
   DYNAMIC FORM ROWS - Строки для динамических элементов форм
   ============================================================================ */

.dynamic-form-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 2px solid #cce3de;
    border-radius: 12px;
    background-color: white;
    transition: all 0.3s ease;
}

.dynamic-form-row:hover {
    border-color: #a4c3b2;
    box-shadow: 0 4px 8px rgba(107, 144, 128, 0.1);
}

.dynamic-form-row select {
    flex: 1;
    border: 2px solid #cce3de;
    border-radius: 8px;
    padding: 0.75rem;
    transition: all 0.3s ease;
    background-color: white;
    color: var(--viridian);
}

.dynamic-form-row select:focus {
    border-color: #a4c3b2;
    box-shadow: 0 0 0 0.2rem rgba(107, 144, 128, 0.15);
    outline: none;
    background-color: var(--azure-web);
}

.dynamic-form-row select option {
    background-color: var(--mint-cream);
    color: var(--viridian);
}

.dynamic-form-row select option:checked {
    background-color: var(--viridian);
    color: white;
}

/* Пустое состояние для динамических контейнеров */
[class*="Container"]:empty::before {
    content: attr(data-empty-text);
    color: #a4c3b2;
    font-style: italic;
    display: block;
    text-align: center;
    padding: 2rem;
    background: #f6fff8;
    border: 2px dashed #cce3de;
    border-radius: 12px;
}

/* ============================================================================
   WARNING ALERT - Предупреждение на странице удаления
   ============================================================================ */

.warning-alert {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

.warning-icon {
    font-size: 3rem;
    color: #ffc107;
    margin-right: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.warning-content {
    flex: 1;
}

.warning-title {
    color: #856404;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.warning-text {
    color: #856404;
    margin: 0;
    font-weight: 500;
}

.delete-info {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid #dc3545;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.1);
}

.badge-count {
    display: inline-block;
    background: #dc3545;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
}

/* ============================================================================
   TABS - Стили для вкладок (nav-tabs)
   ============================================================================ */

.nav-tabs .nav-link {
    color: #000000 !important;
    border: none;
    background: transparent;
}

.nav-tabs .nav-link:hover {
    color: var(--viridian) !important;
    border: none;
}

.nav-tabs .nav-link.active {
    color: var(--viridian) !important;
    font-weight: bold !important;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--viridian) !important;
}

.nav-tabs .nav-link:focus {
    color: var(--viridian) !important;
    box-shadow: none;
}

/* ============================================================================
   АДАПТИВНОСТЬ
   ============================================================================ */

@media (max-width: 768px) {
    .dynamic-form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .warning-alert {
        flex-direction: column;
        text-align: center;
    }

    .warning-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }
}
