/* Sayfa kaymasini onle */
html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.flex {
    display: flex;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

.hidden { display: none !important; }

/* Page layouts */
.page-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.room-layout {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width, 300px);
    grid-template-rows: auto 1fr auto;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.room-topbar {
    grid-column: 1 / -1;
}

.room-main {
    overflow-y: auto;
    padding: 20px;
}

.room-sidebar {
    border-left: 1px solid var(--color-border);
    overflow-y: auto;
}

.room-player {
    grid-column: 1 / -1;
    border-top: 1px solid var(--color-border);
}

/* Responsive */
@media (max-width: 768px) {
    .room-layout {
        display: flex;
        flex-direction: column;
        height: -webkit-fill-available;
        height: 100dvh;
        overflow: hidden;
    }

    /* Topbar sabit - küçülmesin */
    .room-topbar {
        flex-shrink: 0;
    }

    /* Ana içerik kalan alanı kaplar, scroll edilebilir */
    .room-main {
        flex: 1 1 0;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    /* Sidebar - layout'tan çıkar, fixed olarak gelir */
    .room-sidebar {
        display: none !important;
        flex-shrink: 0;
    }

    .room-sidebar.active {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 72vh;
        border-radius: 20px 20px 0 0;
        z-index: 200;
        border-left: none;
        border-top: 1px solid var(--color-border);
        box-shadow: 0 -8px 40px rgba(0,0,0,0.3);
        animation: slideUp 0.3s ease;
    }

    /* Player bar - sabit altta, yüksekliği içeriğe göre */
    .room-player {
        flex-shrink: 0;
        grid-column: unset;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== MOBIL UI IYILESTIRME ===== */
@media (max-width: 768px) {
    /* Topbar - temiz ve kompakt */
    .room-topbar {
        padding: 0 12px;
        gap: 8px;
    }

    .topbar-title {
        font-size: 0.9rem;
        font-weight: 700;
    }

    .topbar-subtitle {
        font-size: 0.7rem;
    }

    /* Sidebar tab butonlari - native app gibi */
    .sidebar-tabs {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0;
        padding: 0;
        border-bottom: 1px solid var(--color-border);
        background: var(--color-bg-secondary);
    }

    .sidebar-tab {
        flex-direction: column;
        gap: 3px;
        padding: 10px 4px;
        font-size: 0.6rem;
        border-radius: 0;
        border-bottom: 2px solid transparent;
        min-height: 56px;
        justify-content: center;
    }

    .sidebar-tab svg {
        width: 20px;
        height: 20px;
    }

    .sidebar-tab.active {
        border-bottom-color: var(--color-accent);
        background: transparent;
    }

    /* Sidebar panel - tam yukseklik */
    .room-sidebar.active {
        height: calc(100dvh - 60px - 80px);
    }

    /* Player bar - daha buyuk dokunma alanlari */
    .player-controls {
        gap: 16px;
    }

    .player-controls button {
        min-width: 44px;
        min-height: 44px;
    }

    #btn-play {
        width: 52px !important;
        height: 52px !important;
    }

    #btn-play svg {
        width: 24px !important;
        height: 24px !important;
    }

    /* Player bilgisi daha buyuk */
    #player-title {
        font-size: 0.92rem;
    }

    #player-artist {
        font-size: 0.75rem;
    }

    /* Arama kutusu */
    .search-container {
        padding: 10px 12px;
    }

    #search-input {
        font-size: 1rem;
        padding: 10px 14px;
        height: 44px;
        border-radius: 22px;
    }

    /* Arama sonuclari */
    .search-result-item {
        padding: 10px 12px;
        gap: 10px;
    }

    .search-result-thumb {
        width: 44px;
        height: 44px;
        border-radius: 6px;
        flex-shrink: 0;
    }

    .search-result-title {
        font-size: 0.85rem;
    }

    .search-result-artist {
        font-size: 0.72rem;
    }

    .result-play-btn,
    .result-queue-btn {
        width: 36px !important;
        height: 36px !important;
    }

    /* Kuyruk listesi */
    .queue-item {
        padding: 10px 12px;
        gap: 10px;
    }

    /* Uye listesi */
    .member-item {
        padding: 10px 12px;
        gap: 10px;
    }

    .member-avatar {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    /* Chat kutusu */
    .chat-input-row {
        padding: 8px;
        gap: 8px;
    }

    #chat-input {
        font-size: 0.95rem;
        height: 40px;
        border-radius: 20px;
    }

    .btn-chat-send {
        width: 40px;
        height: 40px;
        border-radius: 50%;
    }

    /* Mood kartlari - 5 sutun yerine 5 sutun (telefon icin daha uygun) */
    .mood-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }

    .mood-chip {
        padding: 6px 2px 4px;
        border-radius: 8px;
    }

    .mood-chip-emoji {
        font-size: 1.1rem;
    }

    .mood-chip-label {
        font-size: 0.55rem;
    }

    /* Sidebar handle daha belirgin */
    .bottom-sheet-handle {
        width: 40px;
        height: 5px;
        margin: 8px auto 12px;
    }

    /* Admin paneli daha kompakt */
    .ap-section {
        padding: 12px;
    }

    .ap-section-title {
        font-size: 0.72rem;
        margin-bottom: 10px;
    }

    /* Yonetim paneli butonlari daha buyuk */
    .ap-action-btn {
        padding: 10px 12px;
        font-size: 0.82rem;
        min-height: 44px;
    }

    /* Toast bildirimleri */
    .toast-container {
        bottom: 90px;
    }

    /* Lyrics overlay tam ekran mobilde */
    .lyrics-overlay {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}
