@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&display=swap');

:root {
    /* Color Variables */
    --primary-color: #b91c1c; /* Red 700 */
    --primary-hover-color: #991b1b; /* Red 800 */
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --text-color: #ffffff;
    --text-color-soft: #e5e5e5; /* Soft white - modern and easier on eyes */
    --text-color-primary: #f1f5f9; /* Primary content text - slate-100 */
    --text-muted-color: #a0a0a0;
    --text-secondary: #cbd5e0; /* Secondary text - blue-gray-300 */
    --border-color: #333333;
    
    /* Font Variables */
    --font-family-primary: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-primary);
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
    overflow: hidden; /* Prevent body scroll on mobile */
}

.player-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--background-color);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    height: 100vh; /* Ensure container fills the viewport height */
    /* overflow: hidden; -- REMOVED to allow scrolling within children */
    border-radius: 8px; /* For desktop view only */
}

.player-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    padding: 15px 20px;
    /* background: var(--primary-bg); */ /* Replaced with glassmorphism */
    background-color: rgba(37, 37, 38, 1);
    border-color: #333333;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.player-header h3 {
    color: var(--text-color-primary);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.01em;
    margin: 0;
}

.player-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Critical for flexbox scrolling */
    overflow-y: auto; /* Make this the scrollable container */
    position: relative; /* Needed for z-index context if issues arise, good practice */
    border: 1px solid rgba(37, 37, 38, 1);
    
    /* Hide scrollbar for Chrome, Safari, Opera, Edge, and Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.player-main::-webkit-scrollbar {
    display: none; /* Chrome, Safari, and Opera */
}


/* Static Header Layout */
.header-container {
    display: flex;
    flex-direction: column; /* Stack logo and slogan vertically */
    align-items: center;
    justify-content: center;
    gap: 16px; /* Modern way to add space between flex items */
}

.logo {
    width: 128px;
    height: 128px;
    flex-shrink: 0; /* Prevents the logo from shrinking */
    margin-right: 0;
    /* margin-bottom is now handled by the parent's gap property */
    border-radius: 12px; /* Optional: adds rounded corners */
}

.slogan {
    font-size: 1.5rem; /* Adjusted for vertical layout */
    font-weight: 300;
    color: #c9d1d9;
    text-align: center;
}


.progress-container {
    width: 100%;
    height: 6px;
    background-color: #444;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 8px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 4px;
    transition: width 0.1s linear;
}

.time-stamps {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted-color);
    margin-bottom: 20px;
}

.controls-footer {
    z-index: 20;
    padding: 15px 24px;
    border-top: 1px solid #30363d;
    position: relative;
    flex-shrink: 0; /* Prevents the controls from shrinking */
    background-color: rgba(37, 37, 38, 1);
    border-color: #333333;
}

.support-text {
    font-size: 0.7rem;
    color: var(--text-muted-color);
    text-align: center;
    margin-top: 15px;
}


.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    position: relative; /* Add relative positioning context */
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    transition: color 0.2s;
}

.control-btn:hover {
    color: var(--primary-color);
}

.control-btn.play {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    box-shadow: 0 4px 10px rgba(185, 28, 28, 0.4);
    transition: background-color 0.2s;
}

#mute-btn {
    position: absolute; /* Take out of flow */
    right: 0; /* Align to the right of the container */
}

.control-btn.play:hover {
    background-color: var(--primary-hover-color);
}


.speed-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.speed-btn {
    background: #333;
    border: none;
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.speed-btn:hover {
    background-color: #555;
}

.speed-btn.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

#playlist-container {
    padding: 20px;
    background-color: #0d1117;
}

/* Styles for the playlist items */
.playlist {
    flex-grow: 1; /* player-main içinde büyüsün */
    overflow-y: visible; /* player-main scroll yapacak */
    padding: 15px;
}

.playlist-folder-header {
    cursor: pointer;
    padding: 12px;
    background-color: var(--primary-color); /* FIX: Use the exact same red as the play button */
    margin-top: 10px;
    border-radius: 8px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.playlist-folder-header:hover {
    background-color: #dc2626; /* FIX: A slightly brighter red for hover */
}

.playlist-folder-header .arrow {
    transition: transform 0.3s;
}

/* Folder title container */
.folder-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.folder-name {
    flex: 1;
    color: var(--text-color-primary);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.01em;
}

/* Track count badge - Basic style */
.track-count-badge {
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    padding: 3px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    line-height: 1.3;
    border: 1px solid white;
}
.playlist-folder.collapsed .arrow {
    transform: rotate(-90deg);
}

.playlist-tracks {
    padding-left: 15px;
    max-height: 2000px; /* Çok yüksek limit - tüm tracks sığar */
    overflow: visible; /* Tüm tracks görünsün */
    transition: max-height 0.5s ease-in-out, padding 0.3s ease, margin 0.3s ease;
}

.playlist-folder.collapsed .playlist-tracks {
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
}

.playlist-tracks .playlist-item:first-child {
    margin-top: 8px;
}

.playlist-tracks .playlist-item:last-child {
    margin-bottom: 8px;
}

.playlist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    /* border-bottom: 1px solid var(--border-color); */ /* Replaced with margin */
    margin-bottom: 4px; /* Added for spacing */
    border-radius: 6px; /* Added for rounded corners */
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

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

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

.playlist-item.active {
    outline: 1px solid #e53e3e; /* Kırmızı çerçeve */
    outline-offset: -1px; /* Çerçevenin içte kalması için */
    background-color: rgba(229, 62, 62, 0.15); /* Transparan Kırmızı Zemin */
    border-radius: 6px; /* Added for rounded corners */
}

.track-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.track-name {
    font-size: 1rem;
    color: var(--text-color-soft);
    font-weight: var(--font-weight-normal);
    line-height: 1.4;
    letter-spacing: 0.01em;
}

.track-status-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.track-status {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.track-status.status-new {
    background-color: #28a745; /* Yeşil */
    color: #ffffff;
}
.status-completed {
    background-color: #16a34a;
    color: white;
}
.status-progress {
    
    color: var(--text-muted-color);
}

.track-progress-bar-container {
    height: 3px;
    width: 100%;
    background-color: #444;
    border-radius: 1.5px;
    margin-top: 4px;
}
.track-progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 1.5px;
}


.track-refresh-btn {
    background: none;
    border: none;
    color: var(--text-muted-color);
    cursor: pointer;
    margin-left: 15px;
    padding: 5px;
}

.track-refresh-btn:hover {
    color: var(--primary-color);
}

.track-refresh-btn svg {
     width: 18px;
     height: 18px;
}

/* MODAL STYLES */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--surface-color);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 90%;
    width: 350px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.modal-content h2 {
    margin-bottom: 15px;
    color: var(--text-color);
}

.modal-content p {
    margin-bottom: 25px;
    color: var(--text-muted-color);
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-buttons button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

#hcp-yes {
    background-color: var(--primary-color);
    color: white;
}

#hcp-yes:hover {
    background-color: var(--primary-hover-color);
}

#hcp-no {
    background-color: #555;
    color: white;
}

#hcp-no:hover {
    background-color: #777;
}


/* COOKIE CONSENT */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--surface-color);
    padding: 15px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
    z-index: 1001;
    display: none; /* Initially hidden */
}

.cookie-consent p {
    margin: 0;
    text-align: center;
    color: var(--text-muted-color);
    font-size: 0.9rem;
}

#accept-cookie {
    margin-left: 15px;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#accept-cookie:hover {
    background-color: var(--primary-hover-color);
}

/* Scrollbar styling */
.playlist::-webkit-scrollbar {
  width: 8px;
}

.playlist::-webkit-scrollbar-track {
  background: var(--surface-color);
}

.playlist::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 4px;
  border: 2px solid var(--surface-color);
}

@media (max-width: 600px) {
    body {
        padding: 0;
    }
    .player-container {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .player-main {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
    }
    .playlist {
        flex-grow: 1;
        max-height: none;
        padding: 10px;
        padding-bottom: 140px; /* Also add padding here for mobile */
    }
    
    /* Mobile badge adjustments */
    .track-count-badge {
        font-size: 11px;
        padding: 2px 6px;
        min-width: 18px;
        border-radius: 10px;
    }
    
    .folder-title {
        gap: 6px;
    }
}

/* Duration Badge Styles */
.duration-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2a;
    border: 1px solid #404040;
    color: #888888;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 8px;
    white-space: nowrap;
    min-width: 40px;
    height: 20px;
    font-family: var(--font-family-primary);
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    user-select: none;
}

.duration-badge.loading {
    background: #262626;
    border-color: #373737;
    color: #666666;
    animation: durationPulse 1.5s ease-in-out infinite;
}

.duration-badge.loaded {
    background: #2d2d2d;
    border-color: #454545;
    color: #999999;
}

@keyframes durationPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.9; }
}

/* Track info layout adjustment for duration badge */
.track-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    flex-direction: column;
    position: relative;
}

.track-name {
    flex: 1;
    min-width: 0; /* Allow text truncation */
    word-break: break-word;
    line-height: 1.4;
    padding-right: 60px; /* Space for duration badge */
    color: var(--text-color-soft);
    font-weight: var(--font-weight-normal);
    letter-spacing: 0.01em;
}

/* Position duration badge absolutely in top-right */
.duration-badge {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
}

/* New Tracks Popup Styles */
.new-tracks-content {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 0;
    width: 90%;
    max-width: 420px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    animation: newTracksSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center; /* Modal-content gibi center align */
    z-index: 1001; /* Modal-overlay'den üstte olsun */
}

@keyframes newTracksSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.new-tracks-header {
    background: linear-gradient(135deg, var(--primary-color), #dc2626);
    color: white;
    padding: 20px;
    text-align: center;
    border-radius: 16px 16px 0 0;
}

.new-tracks-icon {
    font-size: 32px;
    margin-bottom: 8px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.new-tracks-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.new-tracks-body {
    padding: 24px;
}

.new-tracks-message {
    margin: 0 0 16px 0;
    color: var(--text-color);
    font-size: 14px;
    text-align: center;
}

.new-tracks-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

.new-tracks-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.new-tracks-list li:last-child {
    border-bottom: none;
}

.new-tracks-list li:before {
    content: "•";
    color: var(--primary-color);
    font-size: 16px;
    font-weight: bold;
}

.new-tracks-footer {
    padding: 16px 24px 24px;
    text-align: center;
}

.new-tracks-ok-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.3);
}

.new-tracks-ok-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(185, 28, 28, 0.4);
}

.new-tracks-ok-btn:active {
    transform: translateY(0);
}

/* Mobile responsive for new tracks popup */
@media (max-width: 600px) {
    .new-tracks-content {
        width: 95%;
        max-width: none;
        margin: 20px;
        border-radius: 12px;
    }
    
    .new-tracks-header {
        padding: 16px;
        border-radius: 12px 12px 0 0;
    }
    
    .new-tracks-header h3 {
        font-size: 16px;
    }
    
    .new-tracks-body {
        padding: 20px;
    }
    
    .new-tracks-icon {
        font-size: 28px;
    }
    
    /* Duration badge mobile responsive */
    .track-name {
        padding-right: 50px; /* Less space on mobile */
        font-size: 0.9rem;
        color: var(--text-color-soft);
        font-weight: var(--font-weight-normal);
        letter-spacing: 0.01em;
    }
    
    .duration-badge {
        font-size: 0.7rem;
        padding: 1px 4px;
        min-width: 35px;
        height: 18px;
        top: 1px;
    }
} 

.current-track-name-footer {
    text-align: center;
    font-size: 0.7rem; /* Matched from .support-text */
    color: var(--text-muted-color); /* Matched from .support-text */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 12px; /* mb-2 */
    /* Türkçe karakter desteği */
    font-family: var(--font-family-primary);
    text-rendering: optimizeLegibility;
    -webkit-font-feature-settings: "liga", "kern";
    font-feature-settings: "liga", "kern";
}