/**
 * Modals CSS
 * Модальные окна, оверлеи, баннеры
 */

/* ===== Share Modal ===== */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.share-modal-content {
    background: var(--bg-dark);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.share-modal-title {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--accent-gold);
    margin-bottom: 12px;
}

.share-modal-subtitle {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 24px;
}

.share-link-container {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.share-link-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-size: 0.9rem;
}

.share-link-copy {
    padding: 12px 20px;
    background: var(--accent-gold);
    color: var(--bg-dark);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.share-link-copy:hover {
    background: #e6c200;
}

.share-viewers-info {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 24px;
    font-size: 1.1rem;
}

.share-viewers-info span {
    color: var(--accent-gold);
    font-weight: 600;
}

.share-modal-close {
    padding: 12px 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.share-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== Recording Complete Modal ===== */
.recording-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.recording-modal-content {
    background: var(--bg-dark);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 450px;
    width: 90%;
    text-align: center;
}

.recording-modal-title {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--accent-gold);
    margin-bottom: 12px;
}

.recording-modal-subtitle {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
}

.recording-info {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
}

.recording-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.recording-info-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.recording-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.recording-value {
    color: var(--text-light);
    font-weight: 600;
    font-size: 1rem;
}

.recording-actions {
    display: flex;
    gap: 12px;
}

.recording-actions .btn {
    flex: 1;
}

/* ===== Connection Overlay ===== */
.connection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.connection-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.connection-overlay.fade-out {
    opacity: 0;
}

.connection-content {
    text-align: center;
    max-width: 400px;
    width: 90%;
    padding: 40px;
}

.connection-spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: connectionSpin 1s linear infinite;
}

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

.connection-status {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 30px;
    min-height: 2em;
}

.connection-progress {
    margin-bottom: 30px;
}

.connection-progress .progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.connection-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-gold), #e6c200);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

.connection-progress .progress-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.connection-cancel-btn {
    min-width: 150px;
}

/* Connection success state */
.connection-overlay.success .connection-spinner {
    border-color: #4caf50;
    border-top-color: #4caf50;
    animation: none;
}

.connection-overlay.success .connection-spinner::after {
    content: '\2713';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 2.5rem;
    color: #4caf50;
}

/* Connection error state */
.connection-overlay.error .connection-spinner {
    border-color: #ff6b6b;
    border-top-color: #ff6b6b;
    animation: none;
}

.connection-overlay.error .connection-spinner::after {
    content: '\2715';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 2.5rem;
    color: #ff6b6b;
}

/* Connection Overlay Mobile */
@media (max-width: 480px) {
    .connection-content {
        padding: 30px 20px;
    }

    .connection-spinner {
        width: 60px;
        height: 60px;
        margin-bottom: 24px;
    }

    .connection-status {
        font-size: 1.2rem;
        margin-bottom: 24px;
    }

    .connection-progress {
        margin-bottom: 24px;
    }

    .connection-cancel-btn {
        min-width: 120px;
        padding: 12px 24px;
    }

    .connection-overlay.success .connection-spinner::after,
    .connection-overlay.error .connection-spinner::after {
        font-size: 2rem;
    }
}

/* ===== Return to Room Banner ===== */
.return-to-room-banner {
    background: rgba(200, 170, 110, 0.12);
    border: 1px solid rgba(200, 170, 110, 0.3);
    border-radius: var(--radius-lg, 12px);
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: bannerSlideIn 0.3s ease;
}

@keyframes bannerSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.return-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.return-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.return-label {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--accent-gold);
    font-weight: 600;
}

.return-partner-name {
    font-size: 0.9rem;
    color: var(--text-light);
}

.return-play-title {
    font-size: 0.8rem;
    opacity: 0.6;
    color: var(--text-light);
}

.return-partner-status {
    font-size: 0.75rem;
    color: #4caf50;
}

.return-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.return-dismiss-btn {
    font-size: 0.8rem;
    opacity: 0.6;
}

/* ===== Reconnecting Overlay ===== */
.reconnecting-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.reconnecting-content {
    text-align: center;
    max-width: 360px;
    width: 90%;
    padding: 40px 20px;
}

.reconnecting-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 24px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: connectionSpin 1s linear infinite;
}

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

.reconnecting-text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 24px;
}

.reconnecting-countdown {
    font-weight: 700;
    color: var(--accent-gold);
    font-size: 1.1em;
}

#reconnecting-leave-btn {
    min-width: 160px;
}

/* ===== Time Arrived Modal ===== */
.time-arrived-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.time-arrived-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.time-arrived-content {
    text-align: center;
    padding: 40px 32px;
    max-width: 340px;
    width: calc(100% - 48px);
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: var(--radius-xl);
}

.time-arrived-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
}

.time-arrived-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 8px;
}

.time-arrived-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 28px;
    line-height: 1.4;
}

.time-arrived-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.time-arrived-actions .btn-primary {
    background: var(--accent-gold);
    color: #000;
    border: none;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.time-arrived-actions .btn-primary:hover {
    filter: brightness(1.1);
}

.time-arrived-actions .btn-secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    border: none;
    padding: 10px;
    font-size: 0.85rem;
    cursor: pointer;
}

/* ===== Notification Steps (Три звонка) ===== */
.notification-steps-dark {
    text-align: left;
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
}

.notification-steps-dark .notif-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-steps-dark .notif-item:last-child {
    border-bottom: none;
}

.notification-steps-dark .notif-num {
    min-width: 55px;
    font-size: 14px;
    margin-right: 10px;
    flex-shrink: 0;
}

.notification-steps-dark .notif-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    flex-grow: 1;
}

.notification-steps-dark .notif-time {
    color: #ffffff;
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ===== Badge on Indicator Dots ===== */
.indicator-dot.has-badge {
    position: relative;
}

.indicator-dot.has-badge::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 8px;
    height: 8px;
    background: #ff4444;
    border-radius: 50%;
    border: 1.5px solid #0d0d0d;
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
