/**
 * Kaiser Lobby - Styles
 */

/* ========== LOBBY CONTAINER ========== */
#lobby-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    padding-top: 40px;
}

.lobby-header {
    text-align: center;
    margin-bottom: 30px;
}

.lobby-header h1 {
    font-size: 42px;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
}

.lobby-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
}

/* ========== PLAYER NAME SECTION ========== */
.player-name-section {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 25px;
    backdrop-filter: blur(10px);
}

.player-name-section label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.player-name-section input {
    padding: 10px 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    width: 180px;
}

.player-name-section input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

.player-name-section input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.player-name-section button {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.player-name-section button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ========== ACTION BUTTONS ========== */
.lobby-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.lobby-actions .btn-primary {
    padding: 16px 32px;
    font-size: 18px;
    min-width: 180px;
}

.lobby-actions .btn-primary.queued {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    animation: pulse-queue 1.5s infinite;
}

@keyframes pulse-queue {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(255, 152, 0, 0); }
}

#queue-status {
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    margin-top: 5px;
}

/* ========== JOIN CODE SECTION ========== */
.join-code-section {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.join-code-section label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.join-code-section input {
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 3px;
    text-transform: uppercase;
    width: 140px;
    text-align: center;
}

.join-code-section input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.15);
}

.join-code-section input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 1px;
}

.join-code-section button {
    padding: 12px 24px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.join_code-section button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* ========== CREATE ROOM MODAL ========== */
#create-room-modal .modal-content {
    max-width: 400px;
}

.create-room-content h2 {
    color: var(--primary);
    margin-bottom: 10px;
}

.create-room-content p {
    color: #666;
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.modal-buttons .btn-primary,
.modal-buttons .btn-secondary {
    flex: 1;
}

/* ========== LOBBY NOTIFICATIONS ========== */
.lobby-notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lobby-notification {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    animation: slide-in 0.3s ease-out;
}

.lobby-notification.info {
    background: linear-gradient(135deg, #2196f3, #1976d2);
}

.lobby-notification.success {
    background: linear-gradient(135deg, #4caf50, #388e3c);
}

.lobby-notification.error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.lobby-notification.fade-out {
    animation: fade-out 0.3s ease-out forwards;
}

@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fade-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 700px) {
    #lobby-container {
        padding: 15px;
        padding-top: 20px;
    }

    .lobby-header h1 {
        font-size: 32px;
    }

    .lobby-actions {
        flex-direction: column;
        width: 100%;
    }

    .lobby-actions .btn-primary {
        width: 100%;
    }

    .player-name-section,
    .join-code-section {
        flex-direction: column;
        width: 100%;
        max-width: 350px;
    }

    .player-name-section input,
    .join-code-section input {
        width: 100%;
    }

    .modal-buttons {
        flex-direction: column;
    }
}

/* ========== FOOTER ========== */
.lobby-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    width: 100%;
    max-width: 600px;
}

.lobby-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.lobby-footer a:hover {
    text-decoration: underline;
    color: #fff;
}

/* ========== Emote Picker & Sound ========== */
#emote-picker {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column; /* Stack vertically */
    gap: 10px;
    align-items: center;
}

.icon-toggle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.icon-toggle:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.1);
}

.emote-menu {
    position: absolute;
    bottom: 115px; /* Move above the stacked buttons */
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 12px;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.emote-menu.hidden {
    display: none;
}

.emote-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s;
}

.emote-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.15);
}

/* Player emote bubbles near seats */
.player-emote {
    position: absolute;
    font-size: 32px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 14px;
    padding: 6px 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    z-index: 50;
}

.player-emote.visible {
    opacity: 1;
    transform: scale(1);
}

/* ========== Pause Overlay ========== */
.pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.pause-content {
    text-align: center;
    color: white;
    animation: pulse-pause 2s infinite ease-in-out;
}

.pause-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.pause-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
}

.pause-message {
    font-size: 18px;
    opacity: 0.8;
}

#pause-player-name {
    font-weight: bold;
    color: #ffd700;
}

@keyframes pulse-pause {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.02); opacity: 0.9; }
}

/* Away player state */
.seat.away .avatar {
    background: linear-gradient(135deg, #999, #777);
    border-color: #ff5722;
    box-shadow: 0 0 15px rgba(255, 87, 34, 0.5);
    animation: pulse-away 1.5s infinite;
}

@keyframes pulse-away {
    0%, 100% { opacity: 1; box-shadow: 0 0 15px rgba(255, 87, 34, 0.5); }
    50% { opacity: 0.7; box-shadow: 0 0 25px rgba(255, 87, 34, 0.7); }
}

.lobby-player.away {
    background: #fff8e1;
    border: 1px solid #ffcc80;
}

.lobby-player.away .player-status {
    color: #ff5722;
    font-weight: bold;
}