/* ============================================
   Ponto VIP Music - Premium Design
   Papelaria Ponto VIP
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&display=swap');

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

:root {
    /* Brand Colors - Warm Coral & Deep Navy */
    --primary: #FF6B5B;
    --primary-dark: #E55A4A;
    --primary-light: #FF8577;
    --primary-glow: rgba(255, 107, 91, 0.3);

    --accent: #FFB347;
    --accent-dark: #F5A030;

    --success: #2DD4A8;
    --success-dark: #22B893;
    --success-glow: rgba(45, 212, 168, 0.3);

    --danger: #FF6B6B;
    --danger-dark: #E55555;

    --warning: #FFB347;
    --info: #5BC0EB;

    /* Dark Theme - Rich Navy */
    --bg-dark: #0D1321;
    --bg-card: #1A2332;
    --bg-card-hover: #232F42;
    --bg-input: #263244;
    --bg-hover: #2D3B50;
    --bg-glass: rgba(26, 35, 50, 0.85);

    /* Text Colors */
    --text-primary: #F7F8FA;
    --text-secondary: #A8B4C4;
    --text-muted: #6B7A8F;

    /* Borders */
    --border: rgba(168, 180, 196, 0.12);
    --border-light: rgba(168, 180, 196, 0.2);
    --border-glow: rgba(255, 107, 91, 0.4);

    /* Layout */
    --sidebar-width: 280px;
    --header-height: 72px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 40px var(--primary-glow);

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Animated background gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(255, 107, 91, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(91, 192, 235, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 179, 71, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

/* ============================================
   App Container
   ============================================ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: 0 4px 16px var(--primary-glow);
    position: relative;
    overflow: hidden;
}

.logo-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
}

.logo-text {
    font-family: 'Sora', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-text::after {
    content: ' VIP';
    color: var(--primary);
    font-weight: 800;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-base);
    position: relative;
    font-weight: 500;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
    transition: height var(--transition-base);
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item:hover::before {
    height: 24px;
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 16px var(--primary-glow);
}

.nav-item.active::before {
    display: none;
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    opacity: 0.9;
}

.nav-text {
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.nav-badge {
    position: absolute;
    right: 14px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}

.nav-item.active .nav-badge {
    background: white;
    color: var(--primary);
    box-shadow: none;
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
}

.storage-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.storage-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.storage-value {
    font-family: 'Sora', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-header {
    height: var(--header-height);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-title h1 {
    font-family: 'Sora', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.header-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* ============================================
   Content Sections
   ============================================ */
.content-section {
    display: none;
    padding: 28px 32px;
    flex: 1;
    animation: fadeIn 0.4s ease;
}

.content-section.active {
    display: block;
}

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

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    overflow: hidden;
    transition: all var(--transition-base);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-light), transparent);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
}

.card-header.success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    border-bottom-color: var(--success-dark);
}

.card-header.success .card-title {
    color: white;
}

.card-title {
    font-family: 'Sora', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.card-body {
    padding: 24px;
}

/* ============================================
   Forms
   ============================================ */
.form-input,
.form-textarea {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition-base);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: var(--bg-hover);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 110px;
    font-family: 'DM Sans', monospace;
    line-height: 1.5;
}

.input-row {
    display: flex;
    gap: 14px;
    align-items: center;
}

.input-row .form-input {
    flex: 1;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Sora', sans-serif;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::before {
    opacity: 1;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:disabled::before {
    display: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    color: white;
    box-shadow: 0 4px 14px var(--success-glow);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--success-glow);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(255, 107, 107, 0.3);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--text-primary);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 16px 28px;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.btn-block {
    width: 100%;
    margin-top: 16px;
}

.btn-row {
    display: flex;
    gap: 14px;
    margin-top: 20px;
}

.btn-row .btn {
    flex: 1;
}

.btn-icon {
    font-size: 1.1em;
}

.btn-group {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
}

.btn-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #FF9999;
}

.alert-error::before {
    content: '⚠';
    font-size: 1.1em;
}

/* ============================================
   Tables
   ============================================ */
.table-container {
    overflow-x: auto;
    max-height: 420px;
    overflow-y: auto;
    border-radius: var(--radius-md);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: rgba(0, 0, 0, 0.25);
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tbody tr {
    transition: all var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--bg-card-hover);
}

.table td {
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    font-family: 'Sora', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-info {
    background: rgba(91, 192, 235, 0.15);
    color: var(--info);
    border: 1px solid rgba(91, 192, 235, 0.3);
}

.badge-success {
    background: rgba(45, 212, 168, 0.15);
    color: var(--success);
    border: 1px solid rgba(45, 212, 168, 0.3);
}

.badge-warning {
    background: rgba(255, 179, 71, 0.15);
    color: var(--warning);
    border: 1px solid rgba(255, 179, 71, 0.3);
}

.badge-danger {
    background: rgba(255, 107, 107, 0.15);
    color: var(--danger);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

/* ============================================
   Status Indicators
   ============================================ */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.status-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    opacity: 0.3;
}

.status-dot.queued {
    background: var(--text-muted);
}

.status-dot.processing {
    background: var(--warning);
    animation: pulse 1.5s ease infinite;
}

.status-dot.processing::after {
    background: var(--warning);
    animation: ripple 1.5s ease infinite;
}

.status-dot.completed {
    background: var(--success);
}

.status-dot.error {
    background: var(--danger);
}

.status-dot.cancelled {
    background: var(--text-muted);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

@keyframes ripple {
    0% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(2); opacity: 0; }
}

/* ============================================
   Stats Row
   ============================================ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    text-align: center;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-value {
    font-family: 'Sora', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 6px;
    display: block;
    font-weight: 600;
}

/* ============================================
   Progress Bar
   ============================================ */
.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.progress-title {
    font-weight: 500;
    color: var(--text-primary);
}

.progress-percent {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.3rem;
}

.progress-bar-container {
    height: 10px;
    background: var(--bg-input);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--accent));
    background-size: 200% 100%;
    border-radius: 5px;
    transition: width 0.4s ease;
    animation: shimmer 2s linear infinite;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 100%);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.progress-status {
    margin-top: 14px;
    font-size: 0.9rem;
}

/* ============================================
   Media Info
   ============================================ */
.media-info {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.media-thumbnail {
    width: 220px;
    height: 124px;
    object-fit: cover;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    box-shadow: var(--shadow-md);
}

.media-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.media-title {
    font-family: 'Sora', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.media-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.media-meta::before {
    content: '•';
    color: var(--primary);
}

.playlist-title {
    font-family: 'Sora', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 18px;
}

/* ============================================
   Complete Section
   ============================================ */
.success-icon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    color: white;
    margin: 0 auto 24px;
    animation: successPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 8px 32px var(--success-glow);
}

@keyframes successPop {
    0% { transform: scale(0) rotate(-45deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(10deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.complete-message {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

/* ============================================
   Panel
   ============================================ */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.panel-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
}

.panel-header h3 {
    font-family: 'Sora', sans-serif;
    font-size: 1rem;
    font-weight: 600;
}

.panel-body {
    padding: 24px;
}

.panel-actions {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-top: 18px;
    flex-wrap: wrap;
}

.status-text {
    font-size: 0.9rem;
    color: var(--success);
    font-weight: 500;
}

/* ============================================
   Instructions List
   ============================================ */
.instructions-list {
    color: var(--text-secondary);
    padding-left: 24px;
    margin: 18px 0;
}

.instructions-list li {
    margin-bottom: 10px;
    position: relative;
}

.instructions-list li::marker {
    color: var(--primary);
    font-weight: 700;
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 16px; }
.mb-3 { margin-bottom: 16px; }

/* ============================================
   Queue Table Styles
   ============================================ */
.queue-table-container {
    max-height: 500px;
    overflow-y: auto;
}

.queue-item {
    transition: all var(--transition-fast);
}

.queue-item-processing {
    background: rgba(255, 179, 71, 0.08);
}

.queue-item-completed {
    background: rgba(45, 212, 168, 0.05);
}

.queue-item-error {
    background: rgba(255, 107, 107, 0.05);
}

.queue-item-cancelled {
    opacity: 0.5;
}

.queue-title {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-progress {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.queue-progress .progress-detail {
    color: var(--warning);
    font-weight: 600;
    font-size: 0.85rem;
}

.queue-progress .current-video {
    color: var(--text-muted);
    font-size: 0.75rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}

/* ============================================
   Audio Player
   ============================================ */
.audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 999;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
}

.audio-player.hidden {
    display: none;
}

.player-info {
    flex: 0 0 220px;
    min-width: 0;
}

.player-title {
    display: block;
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 10px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: scale(1.05);
}

.player-btn-main {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    box-shadow: 0 4px 16px var(--primary-glow);
}

.player-btn-main:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    transform: scale(1.08);
    box-shadow: 0 6px 24px var(--primary-glow);
}

.player-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-time {
    font-family: 'Sora', sans-serif;
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 44px;
    text-align: center;
    font-weight: 500;
}

.player-seek {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-input);
    border-radius: 3px;
    cursor: pointer;
}

.player-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px var(--primary-glow);
}

.player-seek::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.player-seek::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-volume-slider {
    width: 90px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-input);
    border-radius: 2px;
    cursor: pointer;
}

.player-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.player-volume-slider::-webkit-slider-thumb:hover {
    background: var(--text-primary);
    transform: scale(1.15);
}

.player-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.player-close {
    font-size: 1.1rem;
    opacity: 0.6;
}

.player-close:hover {
    opacity: 1;
}

/* Play button in tables */
.btn-play {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    color: white;
    box-shadow: 0 2px 8px var(--success-glow);
}

.btn-play:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--success-glow);
}

/* Row currently playing */
.playing-row {
    background: rgba(45, 212, 168, 0.12) !important;
    position: relative;
}

.playing-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--success);
}

.playing-row td:first-child::before {
    content: '♫ ';
    color: var(--success);
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Library table */
.library-table-container {
    max-height: 520px;
}

.library-table {
    table-layout: fixed;
}

.library-title-cell {
    max-width: 280px;
}

.library-title {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.library-extra {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 3px;
}

.library-artist {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.library-duration {
    text-align: center;
    font-family: 'Sora', sans-serif;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.library-size {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.library-filename {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 8px;
}

.table-actions .btn {
    padding: 8px 12px;
    font-size: 0.8rem;
}

/* Checkbox styling */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Ajuste do main-content quando player está visível */
body.player-active .main-content {
    padding-bottom: 90px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Mobile: Sidebar vira Bottom Navigation */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        height: auto;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--border);
        z-index: 1000;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
    }

    .sidebar-header,
    .sidebar-footer {
        display: none;
    }

    .sidebar-nav {
        flex-direction: row;
        padding: 10px 8px;
        gap: 0;
        justify-content: space-around;
        width: 100%;
    }

    .nav-item {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 10px 14px;
        gap: 5px;
        flex: 1;
    }

    .nav-item::before {
        display: none;
    }

    .nav-text {
        display: block;
        font-size: 0.68rem;
        text-align: center;
        font-weight: 600;
    }

    .nav-icon {
        font-size: 22px;
    }

    .nav-badge {
        position: absolute;
        top: 4px;
        right: 50%;
        transform: translateX(100%);
        padding: 2px 6px;
        font-size: 0.6rem;
        min-width: 18px;
    }

    .logo-text,
    .storage-info {
        display: none;
    }

    /* Main Content ajustado para bottom nav */
    .main-content {
        margin-left: 0;
        padding-bottom: calc(75px + env(safe-area-inset-bottom, 0px));
    }

    /* Header fixo com área segura no topo */
    .main-header {
        padding: 0 18px;
        padding-top: env(safe-area-inset-top, 0px);
        height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
    }

    /* Conteúdo precisa respeitar o header fixo */
    .content-section {
        padding: 18px;
        padding-top: calc(var(--header-height) + env(safe-area-inset-top, 0px) + 18px);
    }

    .content-section.active {
        display: block;
        margin-top: 0;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .media-info {
        flex-direction: column;
    }

    .media-thumbnail {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }

    .input-row {
        flex-direction: column;
    }

    .input-row .btn {
        width: 100%;
    }

    .card-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .card-actions {
        width: 100%;
        justify-content: flex-start;
    }

    /* Player mobile */
    .audio-player {
        flex-wrap: wrap;
        padding: 12px 14px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        gap: 10px;
    }

    .player-info {
        flex: 1 1 100%;
        order: 1;
    }

    .player-controls {
        order: 2;
    }

    .player-progress {
        flex: 1 1 auto;
        order: 3;
        min-width: 140px;
    }

    .player-volume {
        display: none;
    }

    .player-close {
        order: 4;
        position: absolute;
        top: 10px;
        right: 10px;
    }

    body.player-active .main-content {
        padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px));
    }

    body.player-active .sidebar {
        bottom: 85px;
    }
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
    transition: background var(--transition-fast);
}

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

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) var(--bg-dark);
}

/* ============================================
   Selection
   ============================================ */
::selection {
    background: var(--primary);
    color: white;
}

/* ============================================
   Focus States (Accessibility)
   ============================================ */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
