/**
 * Screen Backstage CSS
 * Стили экрана Гримёрка (матчинг, форматы)
 */

/* ===== Format Cards Grid ===== */
.formats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 600px;
    width: 100%;
}

.format-card {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    border: 1px solid var(--accent-gold);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.format-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-gold);
    background: rgba(0, 0, 0, 0.6);
}

.format-card--primary {
    border-color: var(--accent-gold);
    background: rgba(0, 0, 0, 0.5);
}

.format-card--primary:hover {
    background: rgba(0, 0, 0, 0.6);
    border-color: var(--accent-gold);
}

.format-card--scheduled {
    border-color: var(--accent-gold);
    background: rgba(0, 0, 0, 0.5);
}

.format-card--scheduled:hover {
    background: rgba(0, 0, 0, 0.6);
    border-color: var(--accent-gold);
}

.format-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.format-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 8px;
}

.format-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

/* ===== Matching Panel ===== */
.matching-panel {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    max-width: 400px;
    width: 100%;
    max-height: calc(100vh - 60px);
    max-height: calc(100dvh - 60px);
    overflow-y: auto;
}

.matching-stage {
    text-align: center;
}

.matching-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

#found-stage .matching-title {
    margin-bottom: 8px;
}

.back-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 16px;
    padding: 8px 0;
    transition: var(--transition-fast);
}

.back-btn:hover {
    color: var(--text-light);
}

/* ===== Criteria Section ===== */
.criteria-section {
    margin-bottom: 24px;
    text-align: left;
}

.checkbox-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.matching-panel .btn--full {
    max-width: 280px;
    margin: -8px auto 0;
}

#criteria-back-btn {
    margin-top: 16px;
}

#want-gender .checkbox-option {
    justify-content: center;
}

#want-ages .checkbox-option:last-child {
    grid-column: 1 / -1;
    justify-content: center;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.checkbox-option:hover {
    background: rgba(255, 255, 255, 0.15);
}

.checkbox-option input {
    display: none;
}

.checkbox-option:has(input:checked) {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: #000;
}

.checkbox-option span {
    font-size: 0.9rem;
}

.form-error {
    color: #ff6b6b;
    font-size: 0.9rem;
    margin-bottom: 16px;
    display: none;
}

/* ===== TG Consent ===== */
.tg-consent {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tg-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #ffffff;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    line-height: 1.4;
}

.tg-consent-label:hover {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(232, 184, 85, 0.3);
}

.tg-consent-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-top: 2px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.tg-consent-label input[type="checkbox"]:checked {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
}

.tg-consent-label input[type="checkbox"]:checked::after {
    content: '✓';
    display: block;
    text-align: center;
    color: #000;
    font-size: 14px;
    line-height: 16px;
    font-weight: bold;
}

.consent-emoji {
    font-size: 1rem;
    margin-right: 4px;
}

.consent-highlight {
    color: var(--accent-gold);
    font-weight: 500;
}

/* ===== Matching Animation ===== */
.matching-animation {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.matching-timer {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin: 20px 0;
}

.matching-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 24px;
}

.matching-progress-bar {
    height: 100%;
    background: var(--accent-gold);
    width: 0%;
    transition: width 1s linear;
}

/* ===== Found Stage ===== */
.found-icon {
    font-size: 2rem;
    margin-bottom: 4px;
}

.partner-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 12px;
    margin: 10px 0;
}

/* ===== Schedule Date Picker ===== */
.schedule-dates {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.schedule-date-btn {
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: center;
}

.schedule-date-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.schedule-date-btn.active {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: #000;
}

.schedule-date-btn .date-day {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 2px;
}

.schedule-date-btn .date-label {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
}

.schedule-date-btn .date-count {
    display: none;
    font-size: 0.65rem;
    color: #4caf50;
    margin-top: 2px;
}

.schedule-date-btn .date-count.has-count {
    display: block;
}

.schedule-date-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    background: rgba(100, 100, 100, 0.2);
}

.schedule-date-btn.disabled .date-count {
    color: #ff6b6b;
}

/* ===== Schedule Time Picker ===== */
.schedule-times {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.schedule-time-btn {
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: center;
}

.schedule-time-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.schedule-time-btn.active {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: #000;
}

.schedule-time-btn .slot-badge {
    display: block;
    font-size: 0.7rem;
    margin-top: 2px;
    opacity: 0.7;
}

.schedule-time-btn.has-matches {
    border-color: var(--accent-gold);
}

.schedule-time-btn.has-matches .slot-badge {
    color: var(--accent-gold);
}

.schedule-time-btn.active .slot-badge {
    color: inherit;
    opacity: 0.8;
}

/* ===== Schedule Preview ===== */
.schedule-preview {
    background: none;
    border: none;
    padding: 0;
    margin-top: 4px;
    text-align: left;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.schedule-preview.visible {
    opacity: 1;
}

.schedule-preview-header {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
}

.schedule-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.schedule-preview-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.schedule-preview-chip .chip-gender {
    opacity: 0.6;
}

/* ===== Schedule Results ===== */
.schedule-results-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.schedule-result-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.schedule-result-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-gold), rgba(212, 175, 55, 0.5));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.schedule-result-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.schedule-result-info {
    flex: 1;
    text-align: left;
}

.schedule-result-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2px;
}

.schedule-result-meta {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.schedule-result-action {
    padding: 8px 16px;
    background: var(--accent-gold);
    border: none;
    border-radius: var(--radius-sm);
    color: #000;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.schedule-result-action:hover {
    background: #e6c34a;
}

/* ===== No Results ===== */
.schedule-no-results {
    text-align: center;
    padding: 30px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.no-results-hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 8px;
}

/* ===== Schedule Confirmation ===== */
.schedule-confirmation {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

/* ===== Screen Content Adjustments ===== */
.screen--wardrobe .screen-content {
    justify-content: flex-start;
    padding-top: 15px;
}

.screen--backstage .screen-content {
    justify-content: flex-start;
    padding-top: 30px;
}
