/* =========================================
   1. PLAYLIST MODAL (LİSTE EKLEME PENCERESİ)
   ========================================= */

/* Modal Overlay (Arka Plan) */
.playlist-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    backdrop-filter: blur(8px);
}

.playlist-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Modal İçerik Kutusu */
.playlist-modal-content {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 420px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid var(--border-color);
    margin: 20px;
}

.playlist-modal.active .playlist-modal-content {
    transform: translateY(0) scale(1);
}

/* Header */
.playlist-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-body);
}

.playlist-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal-btn:hover {
    color: var(--text-main);
    transform: rotate(90deg);
}

/* Liste Alanı */
.playlist-list-container {
    max-height: 300px;
    overflow-y: auto;
    padding: 5px 0;
}

.playlist-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

.playlist-option:hover {
    background-color: var(--bg-body);
}

.playlist-checkbox {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.playlist-label {
    flex: 1;
    color: var(--text-main);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.playlist-label i.fa-lock {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.playlist-label i.fa-globe {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Footer Alanı */
.playlist-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-card);
}

.btn-create-new-pl {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    transition: var(--transition);
    font-weight: 600;
}

.btn-create-new-pl i {
    font-size: 1.1rem;
}

.btn-create-new-pl:hover {
    color: var(--primary-color);
}

/* --- YENİ LİSTE OLUŞTURMA FORMU --- */
.new-playlist-form {
    padding: 20px;
    display: none; /* JS ile açılır */
    background-color: var(--bg-body);
    border-top: 1px solid var(--border-color);
}

.new-playlist-form.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.new-playlist-form input[type="text"],
.new-playlist-form select {
    width: 100%;
    padding: 12px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    margin-bottom: 12px;
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
}

.new-playlist-form input[type="text"]:focus,
.new-playlist-form select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.form-buttons-row {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 15px;
}

.btn-cancel {
    background: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    border-radius: var(--radius-full);
}

.btn-cancel:hover {
    color: var(--text-main);
    background-color: rgba(0,0,0,0.05);
}

.btn-save-pl {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--radius-full);
    padding: 8px 24px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(var(--primary-rgb), 0.3);
}

.btn-save-pl:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.4);
}

.btn-save-pl:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* =========================================
   2. PLAYLIST DETAY SAYFASI (SHOW.PHP)
   ========================================= */

/* Üst Kısım: Kapak ve Bilgiler */
.playlist-header-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-bottom: 30px;
}

/* Sol Taraf: Büyük Kapak */
.playlist-cover-lg {
    width: 280px;
    flex-shrink: 0;
}

.playlist-cover-lg img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.cover-aspect-ratio {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.cover-overlay-icon {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.cover-aspect-ratio:hover .cover-overlay-icon {
    opacity: 1;
}

.cover-overlay-icon i {
    font-size: 4rem;
    color: #fff;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

/* Sağ Taraf: Bilgiler */
.playlist-info-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.playlist-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 10px;
    line-height: 1.2;
}

.playlist-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-item.author a {
    color: var(--text-main);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.meta-item.author a:hover {
    color: var(--primary-color);
}

.dot-sep {
    color: var(--border-color);
}

.badge-visibility {
    background-color: var(--bg-body);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.playlist-desc {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-main);
    margin-bottom: 25px;
    opacity: 0.9;
}

.playlist-actions-row {
    display: flex;
    gap: 15px;
    margin-top: auto;
}

/* Butonlar (Show sayfası için özel stiller gerekirse) */
.btn-action-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 10px 24px;
    border-radius: var(--radius-full);
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-action-outline:hover {
    background-color: var(--bg-body);
    border-color: var(--text-muted);
}

/* =========================================
   3. LİSTE ÖĞELERİ (ITEMS LIST)
   ========================================= */
.playlist-items-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.playlist-item-row {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.playlist-item-row:last-child {
    border-bottom: none;
}

.playlist-item-row:hover {
    background-color: var(--bg-body);
}

.index-num {
    width: 40px;
    text-align: center;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.item-thumb {
    width: 120px;
    height: 68px; /* 16:9 oranı */
    margin: 0 20px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background-color: #000;
}

.item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.item-thumb:hover img {
    transform: scale(1.1);
}

.item-info {
    flex: 1;
    min-width: 0;
    padding-right: 15px;
}

.item-title {
    margin: 0 0 5px 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
}

.item-title a {
    color: var(--text-main); /* İŞTE DÜZELTME BURADA */
    text-decoration: none;
    transition: color 0.2s;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-title a:hover {
    color: var(--primary-color);
}

.item-meta {
    font-size: 0.85rem;
    color: var(--text-muted); /* İŞTE DÜZELTME BURADA */
    display: flex;
    align-items: center;
    gap: 6px;
}

.item-actions {
    margin-left: auto;
}

.btn-icon-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.btn-icon-delete:hover {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .playlist-header-wrapper {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .playlist-cover-lg {
        width: 100%;
        max-width: 400px;
    }

    .playlist-meta-row {
        justify-content: center;
    }

    .playlist-actions-row {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .item-thumb {
        width: 90px;
        height: 50px;
        margin: 0 10px;
    }
    
    .index-num {
        width: 25px;
        font-size: 0.9rem;
    }
    
    .item-title {
        font-size: 0.95rem;
    }
}