body {
    height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background-color: #121212;
    color: #fff;
    font-family: Arial, sans-serif;
}

.container-fluid {
    height: 100vh;
    padding: 10px;
}

.row {
    height: 100%;
}

/* Sol sidebar (kanal listesi) */
#sidebar {
    background-color: #1e1e1e;
    border-radius: 5px;
    padding: 15px;
    height: 100%;
    overflow-y: auto;
    transition: transform 0.3s ease;
    position: fixed;
    z-index: 1000;
    width: 280px;
    left: 0;
    top: 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
}

#sidebar.hidden {
    transform: translateX(-280px);
}

#sidebar h2 {
    margin-bottom: 15px;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Sağ içerik alanı */
#content {
    height: 100%;
    padding-left: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin-left: 0;
    transition: margin-left 0.3s ease;
    width: 100%;
}

#content.sidebar-visible {
    margin-left: 280px;
    width: calc(100% - 280px);
}

/* Tam ekran modunda içerik alanı */
body[fullscreen] #content {
    margin-left: 0 !important;
    padding-left: 0;
    width: 100vw;
}

body[fullscreen] #sidebar {
    z-index: 1100;
}

body[fullscreen] #open-sidebar-btn {
    z-index: 1101;
}

/* Düzen kontrolleri */
.layout-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-direction: column;
}

/* Sidebar toggle butonu */
#sidebar-toggle {
    display: none; /* Eski toggle butonunu gizle */
}

/* Yeni menü açma butonu */
#open-sidebar-btn {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1001;
    background-color: #1e1e1e;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    font-size: 18px;
}

/* Yeni menü kapatma butonu */
#close-sidebar-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: transparent;
    color: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

/* Kanal listesi */
#channel-list {
    overflow-y: auto;
    max-height: calc(100% - 150px);
}

.channel-item {
    padding: 8px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
}

.channel-item:hover {
    background-color: #2a2a2a;
}

.channel-item.dragging {
    opacity: 0.7;
    background-color: #333;
    cursor: grabbing;
}

.channel-item .form-check {
    margin: 0;
    flex: 1;
}

.channel-item .form-check-input {
    background-color: #333;
    border-color: #444;
}

.channel-item .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.channel-item .form-check-label {
    color: #ddd;
    margin-left: 10px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-controls {
    display: flex;
    align-items: center;
}

.channel-controls button {
    color: #999;
    background: none;
    border: none;
    padding: 5px;
}

.channel-controls button:hover {
    color: #fff;
}

/* Player konteyner */
#player-container {
    display: grid;
    gap: 5px;
    height: auto;
    min-height: 600px; /* Minimum yükseklik */
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    padding-right: 5px;
    width: 100%;
}

/* Grid sütunları */
.columns-3 { grid-template-columns: repeat(3, 1fr); }
.columns-4 { grid-template-columns: repeat(4, 1fr); }

/* Sütun butonları için stil */
.btn-outline-secondary.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

/* Player öğesi */
.player-item {
    position: relative;
    background-color: #000;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
    aspect-ratio: 16/9;
    height: auto;
    max-height: 70vh; /* Maksimum yükseklik sınırı */
}

/* 2 sütun için özel stil */
.columns-2 .player-item {
    max-height: 50vh;
}

/* Tek sütun için özel stil */
.columns-1 .player-item {
    max-height: 80vh;
}

@media (max-width: 768px) {
    .columns-3, .columns-4 { grid-template-columns: repeat(2, 1fr); }
    #sidebar {
        margin-bottom: 10px;
        height: auto;
        max-height: 300px;
    }
    .row {
        height: auto;
    }
}

@media (max-width: 576px) {
    .columns-2, .columns-3, .columns-4 { grid-template-columns: repeat(1, 1fr); }
}

/* Player içeriği */
.player-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* İframe */
.player-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Player kontrolleri */
.player-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
}

.player-content:hover .player-controls {
    opacity: 1;
}

.player-controls button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.player-controls button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Tam ekran modu */
body[fullscreen] #sidebar,
body[fullscreen] .layout-controls {
    display: none;
}

body[fullscreen] #player-container {
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow: hidden;
    gap: 5px;
}

body[fullscreen] .player-item {
    margin-bottom: 5px;
    aspect-ratio: 16/9;
    height: auto;
}

.error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.error-overlay.d-none {
    display: none;
}

.error-content {
    color: #fff;
}

/* Aspect ratio sınıfı */
.msk-aspectRatio {
    aspect-ratio: 16 / 9;
    width: 100%;
    height: auto !important;
}

.d-grid {
    display: grid;
}

.btn-outline-secondary {
    background-color: #2a2a2a;
    border-color: #333;
    color: #fff;
    text-align: left;
}

.dropdown-menu {
    background-color: #2a2a2a;
    border-color: #333;
}

.dropdown-item {
    color: #ddd;
}

.dropdown-item:hover {
    background-color: #333;
    color: #fff;
}