/* Mode Tabs */
.mode-tabs {
    background: white;
    padding: 4px;
    border-radius: 10px;
    display: flex;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.mode-btn {
    border: none;
    background: transparent;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--slate-500);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    gap: 6px;
    align-items: center;
}

.mode-btn:hover {
    color: var(--slate-700);
    background: var(--slate-50);
}

.mode-btn.active {
    background: var(--slate-900);
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Toolbar & Icons */
.toolbar {
    max-width: 800px;
    margin: 0 auto 16px;
    display: flex;
    justify-content: flex-end;
}

.control-group {
    background: white;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    display: flex;
    gap: 4px;
}

.icon-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--slate-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.1s;
}

.icon-btn:hover {
    background: var(--slate-50);
    color: var(--slate-900);
}

/* Floating Player (Custom) */
.floating-player {
    position: absolute;
    bottom: 30px;
    /* Default desktop */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    padding: 12px 24px;
    border-radius: 100px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.8);
    z-index: 100;
}

/* Adjust for Mobile Bottom Nav - Will be handled in features/responsive css, but base rule here */
@media (max-width: 768px) {
    .floating-player {
        bottom: 90px;
        /* Space for bottom nav */
        bottom: calc(90px + env(safe-area-inset-bottom));
    }
}

.custom-player-wrapper audio {
    display: none;
}

.custom-controls {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 16px;
}

.progress-bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: var(--slate-200);
    border-radius: 10px;
    transition: background 0.2s;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: -5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.time-display {
    font-size: 0.75rem;
    color: var(--slate-500);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* Button overrides for player */
.circle-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: white;
    color: var(--slate-600);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    display: grid;
    place-items: center;
}

.circle-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.circle-btn:active {
    transform: translateY(0);
}

.circle-btn.primary {
    background: var(--primary);
    color: white;
    border: none;
}

.circle-btn.small {
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.circle-btn.large {
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
    background: var(--slate-900);
    color: white;
    border: none;
}

.text-btn.small {
    font-size: 0.85rem;
    padding: 6px 12px;
    background: var(--slate-100);
    border-radius: 20px;
    color: var(--slate-700);
}

.pill-btn {
    border: 1px solid var(--border-subtle);
    background: white;
    padding: 10px 24px;
    border-radius: 100px;
    font-weight: 600;
    color: var(--slate-700);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.pill-btn:hover {
    background: var(--slate-50);
}

/* --- Login Modal --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

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

.modal__overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal__content {
    position: relative;
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.hidden .modal__content {
    transform: translateY(20px);
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal__header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--slate-800);
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--slate-400);
    cursor: pointer;
    padding: 0.25rem;
}

.btn-close-modal:hover {
    color: var(--slate-800);
}

.login-desc {
    color: var(--slate-500);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Social Login Buttons */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.8rem;
    border-radius: 12px;
    border: 1px solid var(--slate-200);
    background: white;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--slate-700);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-social:hover {
    background: var(--slate-50);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.btn-google {
    color: #333;
}

.btn-kakao {
    background: #FEE500;
    border-color: #FEE500;
    color: #3c1e1e;
}

.btn-kakao:hover {
    background: #fdd835;
}

.btn-apple {
    background: #000;
    color: white;
    border-color: #000;
}

.btn-apple:hover {
    background: #333;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--slate-300);
    font-size: 0.8rem;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--slate-200);
}

.divider span {
    margin: 0 0.5rem;
}

/* Email Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-form input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.login-form input:focus {
    border-color: var(--primary-500);
}

.btn-full {
    width: 100%;
    padding: 0.8rem;
    margin-top: 0.5rem;
}

.auth-switch {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--slate-500);
}

.auth-switch a {
    color: var(--primary-600);
    font-weight: 600;
    text-decoration: none;
}

/* Sidebar Login Button */
.btn-login-sidebar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem;
    background: var(--primary-600);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login-sidebar:hover {
    background: var(--primary-700);
}

.btn-login-sidebar i {
    font-size: 1.25rem;
}