/* ===== Dashtreme Forms - Angular, Compact ===== */

/* Form Group */
.form-group {
    margin-bottom: 12px;
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Form Control - ANGULAR */
.form-control {
    width: 100%;
    padding: 8px 10px;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 0;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-input-focus);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form Control Sizes */
.form-control-sm {
    padding: 5px 8px;
    font-size: var(--font-size-xs);
}

.form-control-lg {
    padding: 10px 12px;
    font-size: var(--font-size-base);
}

/* Select */
.form-select {
    width: 100%;
    padding: 8px 30px 8px 10px;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    background: var(--bg-input) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23888' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") no-repeat right 8px center/10px;
    border: 1px solid var(--border-color);
    border-radius: 0;
    appearance: none;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Textarea */
textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

/* Input Group */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    flex: 1;
}

.input-group-text {
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

/* Light theme form controls */
[data-theme="light"] .form-control,
[data-theme="light"] .form-select {
    background: #f5f7fa !important;
    border-color: rgba(0,0,0,0.15) !important;
    color: #1a2a3a !important;
}

[data-theme="light"] .form-control:focus,
[data-theme="light"] .form-select:focus {
    background: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(23, 162, 184, 0.15) !important;
}

[data-theme="light"] .form-control::placeholder {
    color: #8a9aaa !important;
}

[data-theme="light"] .input-group-text {
    background: #eff1f5 !important;
    border-color: rgba(0,0,0,0.15) !important;
    color: #4a5a6a !important;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.form-check-input {
    width: 14px;
    height: 14px;
    margin: 0;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    cursor: pointer;
    appearance: none;
    transition: all var(--transition-fast);
}

.form-check-input[type="radio"] {
    border-radius: 50%;
}

.form-check-input:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.form-check-input:checked::after {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    height: 100%;
}

.form-check-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    cursor: pointer;
}

/* Switch */
.form-switch .form-check-input {
    width: 32px;
    height: 18px;
    position: relative;
}

.form-switch .form-check-input::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: white;
    transition: transform var(--transition-fast);
}

.form-switch .form-check-input:checked::after {
    transform: translateX(14px);
}

/* ===== BUTTONS - ANGULAR, solid colors ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: white;
    background: var(--primary);
    border: none;
    border-radius: 8px !important;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.btn:hover {
    background: var(--primary-light);
    color: white;
}

.btn:active,
.btn.active {
    background: var(--primary-dark);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Button Variants */
.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-light); }

.btn-success { background: var(--success); }
.btn-success:hover { background: #2dbc4e; }

.btn-warning { background: var(--warning); color: #1a1a2e; }
.btn-warning:hover { background: #ffce3a; }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #e04050; }

.btn-info { background: var(--info); }
.btn-info:hover { background: var(--primary-light); }

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-secondary.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Button Outline */
.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: white;
}

/* Button Sizes */
.btn-sm {
    padding: 4px 8px;
    font-size: 10px;
}

.btn-lg {
    padding: 10px 20px;
    font-size: var(--font-size-sm);
}

.btn-block {
    width: 100%;
}

/* Button Icon */
.btn-icon {
    width: 28px;
    height: 28px;
    padding: 0;
}

.btn-icon.btn-sm {
    width: 22px;
    height: 22px;
}

/* Панель фильтров: одна линия (с переносом на узком экране) */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    width: 100%;
    margin-bottom: 1rem;
    padding: 12px 14px;
    background: rgba(0, 20, 40, 0.35);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-sizing: border-box;
}

.filter-bar .form-check.form-switch {
    margin-bottom: 0;
    flex-shrink: 0;
}

/* Поле поиска растягивается, кнопки справа не «висят в пустоте» */
.filter-bar .search-input {
    flex: 1 1 240px;
    min-width: 180px;
    max-width: 480px;
}
.filter-bar .ms-auto {
    margin-left: auto;
    flex-shrink: 0;
}

/* Light theme filter bar */
[data-theme="light"] .filter-bar {
    background: #ffffff !important;
    border-color: rgba(0,0,0,0.1) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

[data-theme="light"] .filter-bar .form-control,
[data-theme="light"] .filter-bar .form-select {
    background: #f5f7fa !important;
    border-color: rgba(0,0,0,0.12) !important;
    color: #1a2a3a !important;
}

[data-theme="light"] .filter-bar .form-control::placeholder {
    color: #8a9aaa !important;
}

[data-theme="light"] .filter-bar .input-group-text {
    background: #f0f2f5 !important;
    border-color: rgba(0,0,0,0.12) !important;
    color: #4a5a6a !important;
}

.filter-bar > .form-select,
.filter-bar > input.form-control {
    width: auto;
    min-width: 120px;
}

/* Поиск: обёртка flex, сам input — во всю ширину обёртки */
.filter-bar .search-input .form-control {
    width: 100%;
    min-width: 0;
}
.filter-bar .form-select.filter-bar-select-compact {
    width: auto;
    min-width: 100px;
    max-width: 140px;
    flex: 0 0 auto;
}

.filter-bar input[type="date"].form-control {
    width: auto;
    min-width: 140px;
    max-width: 180px;
    flex: 0 0 auto;
}

/* Узкий экран: фильтры столбиком, как на странице пользователей */
@media (max-width: 767.98px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .search-input {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .filter-bar > .form-select,
    .filter-bar > input.form-control,
    .filter-bar > .btn {
        width: 100%;
        max-width: none;
        flex: 1 1 auto;
        min-width: 0 !important;
    }

    .filter-bar .form-select.filter-bar-select-compact {
        width: 100%;
        max-width: none;
    }

    .filter-bar input[type="date"].form-control {
        width: 100%;
        max-width: none;
    }

    .filter-bar .ms-auto {
        margin-left: 0 !important;
        width: 100%;
        flex-shrink: 0;
    }

    .filter-bar .ms-auto.d-flex {
        justify-content: center;
        flex-wrap: wrap;
    }

    /* Кнопки в блоке действий — сеткой, если несколько */
    .filter-bar .ms-auto.d-flex.gap-2 {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 8px !important;
    }

    /* Отзывы: поля внутри обёрток .ratings-filter-field */
    .filter-bar.ratings-filter-bar .ratings-filter-field .form-control,
    .filter-bar.ratings-filter-bar .ratings-filter-field .form-select {
        width: 100%;
        max-width: none;
        min-width: 0 !important;
    }

    .filter-bar.ratings-filter-bar .ratings-filter-field--check {
        padding-bottom: 0;
    }

    .filter-bar.ratings-filter-bar .pb-1 {
        padding-bottom: 0 !important;
    }
}

/* Фильтры страницы «Отзывы» (подписи над контролами) */
.filter-bar.ratings-filter-bar {
    align-items: flex-end;
}

.filter-bar.ratings-filter-bar .ratings-filter-field {
    flex: 0 1 auto;
    min-width: 0;
}

.filter-bar.ratings-filter-bar .ratings-filter-field .form-label {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.filter-bar.ratings-filter-bar .ratings-filter-field .form-select,
.filter-bar.ratings-filter-bar .ratings-filter-field .form-control {
    width: auto;
    max-width: 100%;
}

.filter-bar.ratings-filter-bar .ratings-filter-field--admin .form-select {
    min-width: 14rem;
}

.filter-bar.ratings-filter-bar .ratings-filter-field--narrow .form-control {
    width: 4.5rem;
    min-width: 4.5rem;
}

.filter-bar.ratings-filter-bar .ratings-filter-field--date .form-control {
    min-width: 8.75rem;
}

.filter-bar.ratings-filter-bar .ratings-filter-field--q .form-control {
    min-width: 10rem;
}

.filter-bar.ratings-filter-bar .ratings-filter-field--check .form-check {
    padding-top: 0.125rem;
}

/* Search Input */
.search-input {
    position: relative;
}

.search-input input {
    padding-left: 30px;
}

.search-input i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: var(--icon-size-sm);
}

/* Form Text */
.form-text {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 3px;
}

/* Validation */
.is-invalid {
    border-color: var(--danger) !important;
}

.is-valid {
    border-color: var(--success) !important;
}

.invalid-feedback {
    color: var(--danger);
    font-size: var(--font-size-xs);
    margin-top: 3px;
}
