/* ==============================================
   UI ELEMENTS
   - Buttons, Badges, Tabs
   - Selectors, Dropdowns
   - Notifications
   ============================================== */

/* Language Selector */
.lang-selector {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.lang-selector:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.lang-selector option {
    background: #1a1a2e;
    color: white;
}

/* Standard Buttons & Badges */
.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, #ff8c00 100%);
    color: #000;
    border: none;
    padding: 12px 28px;
    border-radius: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 20px var(--gold-glow);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 15px 30px var(--gold-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    padding: 12px 28px;
    border-radius: 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    filter: grayscale(0.8);
    box-shadow: none !important;
}

.connection-badge {
    transition: all 0.3s ease;
    text-shadow: 0 0 10px currentColor;
}

/* Small Buttons */
.btn-primary-sm {
    background: linear-gradient(135deg, var(--gold) 0%, #ff8c00 100%);
    color: #1a1a1a;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-align: center;
}

.btn-primary-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--gold-glow);
}

.btn-secondary-sm {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    text-align: center;
}

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

/* Category Tabs */
.category-tab {
    padding: 8px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
}

.category-tab.active {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
    box-shadow: 0 4px 15px var(--gold-glow);
}

/* Premium Select Dropdown */
.premium-select {
    width: 100%;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px 20px;
    color: #fff;
    font-size: 1.1rem;
    font-family: inherit;
    letter-spacing: 0.02em;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F3C26A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1.2rem center;
    background-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.premium-select:hover {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(243, 194, 106, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.premium-select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(243, 194, 106, 0.15);
    background-color: rgba(20, 20, 25, 0.9);
}

.premium-select option {
    background-color: #1a1a1a;
    color: #fff;
    padding: 12px;
    font-size: 1rem;
}

/* Mode Language Restriction Hint */
.mode-lang-hint {
    display: none;
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(243, 194, 106, 0.1);
    border: 1px solid rgba(243, 194, 106, 0.25);
    border-radius: 8px;
    color: var(--gold);
    font-size: 0.8rem;
    font-weight: 500;
}

.mode-lang-hint i {
    margin-right: 6px;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--gold);
    color: #000;
    padding: 12px 24px;
    border-radius: 24px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 10px 30px var(--gold-glow);
    z-index: 10000;
    animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes toastIn {
    to {
        transform: translateX(-50%) translateY(0);
    }
}

/* Share Button in Header */
#shareRoomBtn {
    color: var(--text-secondary);
    transition: all 0.2s;
}

#shareRoomBtn:hover {
    color: var(--gold);
    transform: scale(1.1);
}

/* Startup Loading State */
.startup-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    gap: 16px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.startup-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Glass Dropdown Container */
.glass-dropdown {
    min-width: 180px;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: fadeInSlideUp 0.2s ease-out;
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.dropdown-item {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    opacity: 0.8;
}

.dropdown-item span {
    flex: 1;
}

.dropdown-item.danger {
    color: var(--danger);
}

.dropdown-item.danger:hover {
    background: rgba(238, 82, 83, 0.1);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 180px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 5000;
}