/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

/* --- Brand / Logo --- */
.sidebar-brand {
    padding: 28px 24px 20px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand h1 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.sidebar-brand span {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 400;
    display: block;
    margin-top: 3px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* --- Focus Timer --- */
.sidebar-focus {
    padding: 16px 14px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.sidebar-focus .focus-circle {
    width: 80px;
    height: 80px;
}

.sidebar-focus .focus-time {
    font-size: 1rem;
}

.focus-circle {
    position: relative;
    width: 110px;
    height: 110px;
}

.focus-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.focus-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 5;
}

.focus-progress {
    fill: none;
    stroke: var(--accent);
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.focus-time {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

.focus-task {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.focus-next {
    font-size: 0.68rem;
    color: var(--text-secondary);
    text-align: center;
}

/* --- Navigation --- */
.sidebar-nav {
    flex: 1;
    padding: 16px 14px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 4px;
}

.nav-section-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 10px 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 16px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--sidebar-text);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
    user-select: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--sidebar-text-hover);
}

.nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
}

.nav-item.active:hover {
    background: rgba(255, 255, 255, 0.12);
}

.nav-item svg,
.nav-item .nav-icon {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
}

/* --- User Profile (Sidebar Footer) --- */
.sidebar-footer {
    padding: 16px 14px;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: default;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

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

.user-name-row .spotify-mini-btn {
    margin-right: -4px;
}

.user-name {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--sidebar-text-hover, rgba(255, 255, 255, 0.85));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.68rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

.user-agenda-info {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.user-agenda-info.hidden {
    display: none;
}

.user-agenda-info .sa-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.user-agenda-info .sa-live-indicator {
    display: inline-block;
    width: 4px;
    height: 4px;
    background-color: #ef4444;
    border-radius: 50%;
    animation: pulseLive 1.5s infinite;
}

@keyframes pulseLive {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.user-agenda-info .sa-title {
    font-size: 0.7rem;
    color: var(--text-primary, #ffffff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.user-agenda-info .sa-time {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.sidebar-footer .sa-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: color-mix(in srgb, var(--accent) 15%, transparent);
}

.sidebar-footer .sa-progress-container.hidden {
    display: none;
}

.sidebar-footer .sa-progress-fill {
    height: 100%;
    width: 0%;
    transition: width 1s linear;
}

/* ---------- Mobile Toggle ---------- */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

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

/* ---------- Sidebar Overlay (mobile) ---------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 90;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    display: block;
}

/* Sidebar açıkken toggle'ı gizle (JS .hidden ekler) */
.sidebar-toggle {
    transition: opacity 0.2s ease;
}

.sidebar-toggle.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ---------- Spotify Widget ---------- */
.spotify-mini-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
    cursor: pointer;
}

.spotify-mini-btn.compact-toggle {
    background: transparent;
    color: var(--text-secondary);
}

.spotify-mini-btn.compact-toggle:hover {
    color: #1DB954;
    background: rgba(30, 215, 96, 0.1);
    transform: scale(1.08);
}

/* Light Theme overrides for Spotify toggle */
[data-theme="white"] .spotify-mini-btn.compact-toggle,
[data-theme="light"] .spotify-mini-btn.compact-toggle {
    color: rgba(0, 0, 0, 0.4);
}
[data-theme="white"] .spotify-mini-btn.compact-toggle:hover,
[data-theme="light"] .spotify-mini-btn.compact-toggle:hover {
    color: #1DB954;
}

/* Old Sidebar Agenda Container Extracted to Footer */

/* Fallback/Overrides removed since we use standard theme CSS vars */

/* Genişletilmiş mod */
.spotify-expanded {
    position: relative;
    animation: spotifySlideIn 0.2s ease;
    margin: 0 14px 14px 14px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.spotify-expanded.hidden {
    display: none;
}

@keyframes spotifySlideIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Removed spotify-collapse-btn logic */

/* Login */
.spotify-login {
    padding: 4px 0;
}

.spotify-connect-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 18px;
    border: none;
    background: #1DB954;
    color: #fff;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    justify-content: center;
}

.spotify-connect-btn:hover {
    background: #1ed760;
    transform: scale(1.02);
}

/* Player — kompakt tek satır */
.spotify-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spotify-art {
    width: 36px;
    height: 36px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}

.spotify-art[src=""] {
    display: none;
}

.spotify-info {
    flex: 1;
    min-width: 0;
}

.spotify-track-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.spotify-artist {
    font-size: 0.64rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Controls — sağ taraf */
.spotify-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.spotify-ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 0;
    padding: 0;
}

.spotify-ctrl-btn:hover {
    color: #fff;
}

.spotify-ctrl-btn.spotify-play-btn {
    width: 24px;
    height: 24px;
    background: var(--accent);
    color: #fff;
}

.spotify-ctrl-btn.spotify-play-btn:hover {
    background: var(--accent);
    filter: brightness(1.15);
    transform: scale(1.06);
}

/* No-device durumu */
.spotify-info.no-device .spotify-track-name {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Light tema */
[data-theme="white"] .spotify-track-name,
[data-theme="light"] .spotify-track-name {
    color: rgba(0, 0, 0, 0.85);
}

[data-theme="white"] .spotify-ctrl-btn,
[data-theme="light"] .spotify-ctrl-btn {
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="white"] .spotify-ctrl-btn:hover,
[data-theme="light"] .spotify-ctrl-btn:hover {
    color: rgba(0, 0, 0, 0.85);
}

[data-theme="white"] .spotify-ctrl-btn.spotify-play-btn,
[data-theme="light"] .spotify-ctrl-btn.spotify-play-btn {
    background: var(--accent);
    color: #fff;
}

[data-theme="white"] .spotify-ctrl-btn.spotify-play-btn:hover,
[data-theme="light"] .spotify-ctrl-btn.spotify-play-btn:hover {
    background: var(--accent);
    filter: brightness(1.15);
}

[data-theme="white"] .spotify-art,
[data-theme="light"] .spotify-art {
    background: rgba(0, 0, 0, 0.05);
}

/* ---------- Main Content ---------- */