/* Spotify Clone - Base Styles */

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

html {
    font-size: 16px;
}

.spotify-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-base);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

/* Spotify App Container */
.spotify-app {
    display: grid;
    grid-template-areas: 
        "sidebar main"
        "player player";
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: 1fr var(--player-height);
    height: 100vh;
    gap: 8px;
    padding: 8px;
    background: var(--bg-base);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-elevated-base);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: var(--misc-non-text-subdued);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-subdued);
}

/* Button Reset */
button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: inherit;
    font: inherit;
}

button:focus {
    outline: 2px solid var(--essential-bright-accent);
    outline-offset: 2px;
}

/* Link Reset */
a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Input Reset */
input {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
}

input:focus {
    outline: 2px solid var(--essential-bright-accent);
    outline-offset: 2px;
}

/* SVG Icons */
svg {
    display: block;
    fill: currentColor;
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--z-index-overlay);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-subdued);
    border-top: 3px solid var(--essential-bright-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-m);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: var(--spacing-l);
    right: var(--spacing-l);
    z-index: var(--z-index-tooltip);
}

.toast {
    background: var(--bg-elevated-base);
    color: var(--text-base);
    padding: var(--spacing-m);
    border-radius: var(--border-radius-l);
    box-shadow: var(--shadow-elevated);
    margin-bottom: var(--spacing-s);
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--essential-positive);
}

.toast.error {
    border-left: 4px solid var(--essential-negative);
}

.toast.warning {
    border-left: 4px solid var(--essential-warning);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modal Base */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-index-modal);
}

.modal-content {
    background: var(--bg-elevated-base);
    border-radius: var(--border-radius-l);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-l);
    border-bottom: 1px solid var(--border-base);
}

.modal-header h2 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-subdued);
    font-size: 24px;
    transition: var(--transition-base);
}

.modal-close:hover {
    background: var(--bg-elevated-highlight);
    color: var(--text-base);
}

.modal-body {
    padding: var(--spacing-l);
}

.modal-footer {
    padding: var(--spacing-l);
    border-top: 1px solid var(--border-base);
    display: flex;
    gap: var(--spacing-m);
    justify-content: flex-end;
}

/* Primary Button */
.primary-btn {
    background: var(--essential-bright-accent);
    color: var(--bg-base);
    padding: var(--spacing-m) var(--spacing-xl);
    border-radius: 500px;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-m);
    transition: var(--transition-base);
}

.primary-btn:hover {
    background: var(--spotify-green-hover);
    transform: scale(1.04);
}

/* Secondary Button */
.secondary-btn {
    background: transparent;
    color: var(--text-subdued);
    padding: var(--spacing-m) var(--spacing-xl);
    border: 1px solid var(--border-bright);
    border-radius: 500px;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-m);
    transition: var(--transition-base);
}

.secondary-btn:hover {
    color: var(--text-base);
    border-color: var(--text-base);
}

/* Hide/Show utilities */
.hide {
    display: none !important;
}

.show {
    display: block !important;
}
