/* ==============================================
   MODALS & OVERLAYS
   - Settings & Create Room Overlay
   - Login & Auth Modals
   - Social Share Modal
   ============================================== */

/* Base Overlay */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.create-room-modal {
    max-width: 600px;
}

.modal-content {
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: none;
}

.modal-content::-webkit-scrollbar {
    display: none;
}

.settings-card {
    width: 100%;
    max-width: 500px;
    padding: 32px;
    border-radius: 32px;
    background: var(--bg-glass);
    border: 1px solid var(--glass-border);
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.8);
}

.modal-header h3 {
    font-size: 1.8rem;
    margin-bottom: 24px;
    color: var(--gold);
    font-weight: 800;
    text-align: center;
}

.modal-close-icon {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.modal-close-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

.form-group label span.guest-counter {
    font-size: 0.8rem;
    color: var(--gold);
    font-weight: normal;
    background: rgba(243, 194, 106, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

.form-group input[type="text"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px 18px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.form-group input[type="text"]:focus {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.08);
}

.topic-input-wrapper {
    position: relative;
    display: flex;
    gap: 12px;
    align-items: center;
}

.topic-input-wrapper input {
    flex: 1;
}

.btn-text-action {
    background: none;
    border: none;
    color: var(--gold);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.btn-text-action:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.btn-text-action i {
    font-size: 1.2rem;
}

.modal-footer {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

.modal-footer button {
    flex: 1;
}

/* Character Selection Grid */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    margin-bottom: 12px;
}

.char-select-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
}

.char-select-card:hover {
    background: rgba(255, 255, 255, 0.08);
}

.char-select-card.selected {
    background: rgba(243, 194, 106, 0.15);
    border-color: var(--gold);
}

.char-select-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.char-select-card.selected .char-select-avatar {
    border-color: var(--gold);
}

.char-select-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.char-select-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.char-select-card.selected .char-select-name {
    color: var(--gold);
    font-weight: 700;
}

/* Social Share Modal */
.social-btn-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.social-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: var(--gold);
}

.social-btn i {
    font-size: 1.5rem;
}

.social-btn .fa-x-twitter {
    color: #fff;
}

.social-btn .fa-whatsapp {
    color: #25D366;
}

.social-btn .fa-weixin {
    color: #07C160;
}

.social-btn .fa-link {
    color: var(--gold);
}

/* Creation Mode Switcher (within room creation modal) */
.creation-mode-switcher {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px;
    border-radius: 16px;
}

.mode-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mode-tab.active {
    background: var(--gold);
    color: #1a1a1a;
    box-shadow: 0 4px 15px var(--gold-glow);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- Premium Confirmation Modal Redesign --- */
.confirm-modal-premium {
    max-width: 420px;
    padding: 0;
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    background: linear-gradient(135deg, rgba(25, 25, 25, 0.8) 0%, rgba(15, 15, 15, 0.95) 100%);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    position: relative;
}

.modal-body-premium {
    padding: 48px 40px 32px;
    text-align: center;
}

.confirm-icon-glow {
    width: 80px;
    height: 80px;
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    font-size: 2.8rem;
    color: var(--gold);
    background: rgba(255, 191, 0, 0.08);
    position: relative;
    box-shadow: inset 0 0 20px rgba(255, 191, 0, 0.05);
}

.confirm-icon-glow::after {
    content: '';
    position: absolute;
    inset: -10px;
    background: var(--gold);
    opacity: 0.15;
    filter: blur(25px);
    border-radius: 50%;
    z-index: -1;
}

/* Danger Variant - Sophisticated Sunset/Crimson */
.confirm-modal-premium.danger .confirm-icon-glow {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.06);
    box-shadow: inset 0 0 20px rgba(255, 107, 107, 0.03);
}

.confirm-modal-premium.danger .confirm-icon-glow::after {
    background: #ff6b6b;
    opacity: 0.1;
}

.premium-modal-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.premium-modal-msg {
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
    font-size: 1.05rem;
    margin-bottom: 0;
}

.confirm-actions-premium {
    padding: 24px 32px 32px;
    display: flex;
    gap: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.confirm-actions-premium button {
    flex: 1;
    height: 54px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.btn-secondary-premium {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary-premium:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.btn-primary-premium {
    background: var(--gold);
    color: #000000;
    border: none;
    box-shadow: 0 10px 20px -5px rgba(255, 191, 0, 0.3);
}

.btn-primary-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -8px rgba(255, 191, 0, 0.45);
    filter: brightness(1.1);
}

.confirm-modal-premium.danger .btn-primary-premium {
    background: linear-gradient(135deg, #ff6b6b 0%, var(--danger) 100%);
    color: #ffffff;
    box-shadow: 0 10px 20px -5px rgba(238, 82, 83, 0.25);
}

.confirm-modal-premium.danger .btn-primary-premium:hover {
    box-shadow: 0 15px 30px -8px rgba(238, 82, 83, 0.4);
}

/* Animations */
@keyframes premiumModalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.confirm-modal-premium {
    animation: premiumModalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}