/* -------------------------------------------------------------
   STYLE.CSS - SonoraMonitor
   Tema Claro: Preto, Branco e Roxo
   ------------------------------------------------------------- */

/* Variables / Design System */
:root {
    --bg-primary: #FFFFFF;
    --bg-secondary: #FAFAFE;
    --bg-tertiary: #F4F1FB;
    
    --text-primary: #0A0812;
    --text-secondary: #5F596C;
    --text-muted: #8E879C;
    
    --purple-primary: #7C3AED;
    --purple-hover: #6D28D9;
    --purple-light: #F3E8FF;
    --purple-light-hover: #E9D5FF;
    --purple-dark: #4C1D95;
    
    --black: #000000;
    --white: #FFFFFF;
    --gray-light: #F3F4F6;
    
    --border-color: #E6E2EE;
    --border-color-focus: #A78BFA;
    
    --error-color: #DC2626;
    --error-bg: #FEF2F2;
    --success-color: #16A34A;
    --success-bg: #DCFCE7;
    
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --shadow-sm: 0 2px 4px rgba(12, 10, 20, 0.03);
    --shadow-md: 0 8px 30px -4px rgba(124, 58, 237, 0.08), 0 4px 12px -2px rgba(12, 10, 20, 0.03);
    --shadow-lg: 0 20px 40px -10px rgba(124, 58, 237, 0.12), 0 10px 20px -5px rgba(12, 10, 20, 0.04);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.25;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

button, input, select, textarea {
    font-family: inherit;
    color: inherit;
}

.hidden {
    display: none !important;
}

.text-secondary {
    color: var(--text-secondary);
}

.text-purple {
    color: var(--purple-primary);
}

.text-success {
    color: var(--success-color);
}

.purple-text {
    color: var(--purple-primary);
}

.purple-bg {
    background-color: var(--purple-light);
    color: var(--purple-primary);
}

.black-bg {
    background-color: var(--text-primary);
    color: var(--white);
}

.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 1.5rem 0;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}

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

/* -------------------------------------------------------------
   BUTTONS
   ------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.75rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-primary {
    background-color: var(--purple-primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--purple-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

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

.btn-outline {
    background-color: var(--white);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: var(--bg-secondary);
    border-color: var(--text-muted);
}

.btn-outline.active {
    background-color: var(--purple-light);
    border-color: var(--purple-primary);
    color: var(--purple-primary);
}

.btn-purple-outline {
    background-color: transparent;
    border-color: var(--purple-primary);
    color: var(--purple-primary);
}

.btn-purple-outline:hover {
    background-color: var(--purple-light);
}

/* -------------------------------------------------------------
   INPUTS & LABELS
   ------------------------------------------------------------- */
label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--border-color-focus);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid var(--text-secondary);
    border-bottom: 2px solid var(--text-secondary);
    pointer-events: none;
    transform: translateY(-75%) rotate(45deg);
    transition: all var(--transition-fast);
}

.select-wrapper select {
    appearance: none;
    cursor: pointer;
}

/* Custom Sliders */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--purple-primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.4);
    transition: transform var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    background: var(--purple-hover);
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.control-val {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--purple-primary);
}

.rate-indicator {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-align: right;
}

/* -------------------------------------------------------------
   1. LOGIN SCREEN
   ------------------------------------------------------------- */
.login-page {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-secondary);
    overflow: hidden;
}

.login-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    background-color: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 3rem 2.5rem;
    animation: slideUp var(--transition-normal);
}

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

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.logo-icon {
    width: 2rem;
    height: 2rem;
    color: var(--purple-primary);
    padding: 0.25rem;
    background: var(--purple-light);
    border-radius: var(--radius-sm);
}

.login-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.input-group {
    margin-bottom: 1.25rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.input-wrapper input:focus {
    outline: none;
    background-color: var(--white);
    border-color: var(--border-color-focus);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.input-icon {
    position: absolute;
    left: 1rem;
    width: 1.15rem;
    height: 1.15rem;
    color: var(--text-muted);
}

.password-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 0.25rem;
}

.password-toggle:hover {
    color: var(--text-primary);
}

.error-message {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: var(--error-bg);
    color: var(--error-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(220, 38, 38, 0.15);
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.shake-anim {
    animation: shake 0.4s ease-in-out;
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Background Glowing Effects */
.ambient-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: 1;
    pointer-events: none;
}

/* -------------------------------------------------------------
   2. DASHBOARD LAYOUT
   ------------------------------------------------------------- */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    background-color: var(--white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.sidebar-nav a i {
    width: 1.25rem;
    height: 1.25rem;
}

.sidebar-nav li.active a,
.sidebar-nav a:hover {
    color: var(--purple-primary);
    background-color: var(--purple-light);
}

.sidebar-nav li.active a {
    font-weight: 700;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-secondary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background-color: var(--text-primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    color: var(--error-color);
    background-color: var(--error-bg);
}

/* Main Content Area */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 2.5rem;
    max-width: 1400px;
    width: calc(100% - 260px);
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.header-left h1 {
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 1rem;
    width: 1.15rem;
    height: 1.15rem;
    color: var(--text-muted);
}

.search-box input {
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    width: 250px;
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    width: 320px;
    border-color: var(--border-color-focus);
}

.header-badge {
    display: flex;
}

.badge {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.badge-success {
    background-color: var(--success-bg);
    color: var(--success-color);
}

.badge-purple {
    background-color: var(--purple-light);
    color: var(--purple-primary);
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-md);
}

.live-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: var(--purple-primary);
}

.animate-pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(124, 58, 237, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); }
}

/* -------------------------------------------------------------
   KPI GRID
   ------------------------------------------------------------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

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

.kpi-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.kpi-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon i {
    width: 1.25rem;
    height: 1.25rem;
}

.kpi-value {
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.kpi-footer {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.trend {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    font-weight: 700;
}

.trend i {
    width: 0.85rem;
    height: 0.85rem;
}

.trend.positive {
    color: var(--success-color);
}

/* -------------------------------------------------------------
   CHARTS & SECTIONS
   ------------------------------------------------------------- */
.charts-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .charts-layout {
        grid-template-columns: 1fr;
    }
}

.chart-container {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.chart-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.chart-header p {
    font-size: 0.85rem;
}

.chart-actions {
    display: flex;
    gap: 0.5rem;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 320px;
}

/* Bottom Grid (Top Músicas + Simulator Widget) */
.bottom-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .bottom-grid {
        grid-template-columns: 1fr;
    }
}

.panel-section {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.panel-header h3 {
    font-size: 1.15rem;
}

/* Tables styling */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

.data-table th {
    padding: 0.75rem 1rem;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr {
    transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
    background-color: var(--bg-secondary);
}

/* Song cover icon */
.song-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.song-cover-mini {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.song-cover-mini.purple {
    background: var(--purple-light);
    color: var(--purple-primary);
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.song-cover-mini.black {
    background: var(--text-primary);
    color: var(--white);
}

.song-cover-mini.grey {
    background: var(--gray-light);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.song-title-wrapper {
    display: flex;
    flex-direction: column;
}

.song-title-wrapper .title {
    font-weight: 700;
    color: var(--text-primary);
}

.song-title-wrapper .artist {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-indicator::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-indicator.active {
    color: var(--success-color);
}

.status-indicator.active::before {
    background-color: var(--success-color);
}

.status-indicator.paused {
    color: var(--text-muted);
}

.status-indicator.paused::before {
    background-color: var(--text-muted);
}

/* Quick simulator details */
.simulator-card-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.simulation-metric-box {
    background-color: var(--purple-light);
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.simulation-metric-box .label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--purple-dark);
}

.simulation-metric-box .value-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 0.25rem;
}

.simulation-metric-box .simulated-value {
    font-size: 1.75rem;
    font-weight: 800;
}

.simulation-metric-box .simulated-diff {
    font-size: 0.85rem;
    font-weight: 700;
}

.simulation-metric-box .simulated-diff.positive {
    color: var(--success-color);
}

.quick-sim-footer {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* -------------------------------------------------------------
   3. FULL SONGS MANAGER TAB
   ------------------------------------------------------------- */
.section-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.section-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-card-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
}

.full-table {
    margin: 0 -2rem -2rem -2rem;
}

.full-table th:first-child,
.full-table td:first-child {
    padding-left: 2rem;
}

.full-table th:last-child,
.full-table td:last-child {
    padding-right: 2rem;
}

.text-right {
    text-align: right;
}

.actions-cell {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-icon {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    color: var(--purple-primary);
    border-color: var(--purple-primary);
    background-color: var(--purple-light);
}

.btn-icon.btn-delete:hover {
    color: var(--error-color);
    border-color: var(--error-color);
    background-color: var(--error-bg);
}

.btn-icon i {
    width: 1rem;
    height: 1rem;
}

/* -------------------------------------------------------------
   4. ADVANCED SIMULATOR TAB
   ------------------------------------------------------------- */
.simulator-layout {
    display: grid;
    grid-template-columns: 4fr 5fr;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .simulator-layout {
        grid-template-columns: 1fr;
    }
}

.simulator-controls-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.simulator-controls-card h2 {
    font-size: 1.35rem;
}

.simulator-controls-card h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.simulator-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.simulator-results-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-header h3 {
    font-size: 1.35rem;
}

.simulation-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.sim-metric-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-secondary);
}

.sim-metric-card.focus-purple {
    background-color: var(--purple-light);
    border-color: rgba(124, 58, 237, 0.2);
}

.sim-metric-card .label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.sim-metric-card.focus-purple .label {
    color: var(--purple-dark);
}

.sim-metric-card .value {
    font-size: 1.5rem;
    font-weight: 850;
    letter-spacing: -0.01em;
}

.simulation-chart-box {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    background-color: var(--bg-secondary);
}

.simulation-chart-box h4 {
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

.warning-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background-color: var(--bg-tertiary);
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.warning-box i {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    color: var(--purple-primary);
}

/* -------------------------------------------------------------
   5. MODAL OVERLAY
   ------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(10, 8, 18, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity var(--transition-normal);
}

.modal-overlay.hidden {
    display: none;
}

.modal-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: zoomIn var(--transition-normal);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
}

.close-modal {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
}

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

#add-song-form {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: flex;
    flex-direction: column;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* -------------------------------------------------------------
   RESPONSIVE LAYOUTS
   ------------------------------------------------------------- */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar .user-info,
    .sidebar .logo span,
    .sidebar-nav span {
        display: none;
    }
    
    .sidebar-header {
        padding: 1.5rem 0.5rem;
        display: flex;
        justify-content: center;
    }
    
    .sidebar-nav {
        padding: 1rem 0.5rem;
    }
    
    .sidebar-nav a {
        justify-content: center;
        padding: 0.75rem;
    }
    
    .sidebar-footer {
        padding: 1rem 0.5rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-content {
        margin-left: 70px;
        width: calc(100% - 70px);
        padding: 1.5rem;
    }
    
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }
    
    .header-right {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .search-box {
        width: 100%;
    }
    
    .search-box input {
        width: 100% !important;
    }
}

/* -------------------------------------------------------------
   NOVAS FUNCIONALIDADES: WARNING BANNER, BLUR, PLAYLISTS & LAYOUT
   ------------------------------------------------------------- */
.spotify-warning-banner {
    background-color: var(--purple-light);
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-left: 4px solid var(--purple-primary);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.spotify-warning-banner .warning-icon {
    color: var(--purple-primary);
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
}

.warning-text-container {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    line-height: 1.4;
}

.warning-text-container strong {
    color: var(--text-primary);
    font-weight: 700;
}

.warning-text-container span {
    color: var(--text-secondary);
}

.blurred-text {
    filter: blur(5.5px);
    user-select: none;
    pointer-events: none;
}

.full-width-grid {
    grid-template-columns: 1fr !important;
}

/* Aba de Playlists - Manutenção */
.maintenance-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3.5rem 2.5rem;
    text-align: center;
    max-width: 600px;
    margin: 4rem auto;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.maintenance-icon-wrapper {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    background-color: var(--purple-light);
    color: var(--purple-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.maintenance-icon {
    width: 2.25rem;
    height: 2.25rem;
}

.maintenance-card h2 {
    font-size: 1.65rem;
    font-weight: 800;
}

.maintenance-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 440px;
}

.maintenance-footer {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    width: 100%;
    padding-top: 1.5rem;
    margin-top: 1rem;
}

/* -------------------------------------------------------------
   RESTRICTION MODAL & ADVANCED MOBILE RESPONSIVENESS
   ------------------------------------------------------------- */
.modal-alert {
    max-width: 440px !important;
}

.modal-body-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 2rem 0.5rem 2rem;
}

.alert-icon-circle {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    background-color: var(--purple-light);
    color: var(--purple-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.alert-icon-circle i {
    width: 2.25rem;
    height: 2.25rem;
}

.alert-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    text-align: center;
}

/* Custom header for warning modal */
.header-danger h2 {
    color: var(--black);
}

/* Responsive improvements for smaller screens */
@media (max-width: 576px) {
    .main-content {
        padding: 1rem;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .kpi-card {
        padding: 1.25rem;
    }
    
    .kpi-value {
        font-size: 1.6rem;
    }
    
    .charts-layout {
        gap: 1rem;
    }
    
    .chart-container {
        padding: 1rem;
    }
    
    .chart-wrapper {
        height: 260px;
    }
    
    .spotify-warning-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.85rem 1rem;
    }
    
    .spotify-warning-banner .warning-icon {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    .maintenance-card {
        padding: 2rem 1.5rem;
        margin: 2rem 0;
    }
    
    .maintenance-card h2 {
        font-size: 1.35rem;
    }
}

/* -------------------------------------------------------------
   MOBILE LAYOUT & CHARTS RESPONSIVENESS (NO OVERFLOW)
   ------------------------------------------------------------- */
@media (max-width: 768px) {
    /* Restore the sidebar on mobile as a collapsed icon bar (70px wide) */
    .sidebar {
        display: flex !important;
        width: 70px !important;
    }
    
    /* Main Content sits next to the collapsed 70px sidebar */
    .main-content {
        margin-left: 70px !important;
        width: calc(100% - 70px) !important;
        padding: 1rem 0.75rem 1.5rem 0.75rem !important;
        overflow-x: hidden;
    }
    
    /* Force charts layout to shrink, stack vertically and avoid overflow */
    .charts-layout {
        grid-template-columns: 1fr !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow: hidden !important;
        gap: 1.25rem !important;
    }
    
    .chart-container {
        width: 100% !important;
        min-width: 0 !important;
        overflow: hidden !important;
        padding: 1rem !important;
    }
    
    .chart-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        height: 250px !important;
        overflow: hidden !important;
    }
    
    /* Stack chart title and buttons to prevent width stretching */
    .chart-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    
    .chart-actions {
        justify-content: flex-start !important;
        width: 100% !important;
    }

    /* Stacking header content inside cards to prevent flex width stretching */
    .section-card-header,
    .panel-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
        text-align: left !important;
    }

    .section-card-header button,
    .panel-header button {
        width: 100% !important;
    }

    /* Outer card responsiveness and padding reductions */
    .section-card {
        padding: 1rem !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .panel-section {
        padding: 1rem !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    /* Negative margins adjust to the new 1rem padding of card */
    .full-table {
        margin: 0 -1rem -1rem -1rem !important;
    }

    /* Absolute scrolling container for tables inside cards */
    .table-container {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Ensure table itself can expand to scroll, but container bounds it */
    .data-table {
        min-width: 950px !important; /* Forces scroll bar inside container and ensures all columns fit without squishing */
    }

    .data-table th,
    .data-table td {
        white-space: nowrap !important; /* Prevents text from wrapping and ensures full readability */
    }

    /* Prevent warning texts and badges from pushing width */
    .warning-text-container span {
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 2.25rem 1.5rem !important;
        margin: 1rem;
        width: 100%;
        max-width: 90% !important;
    }
    
    /* Ensure modals have safe padding margins on tiny viewports */
    .modal-overlay {
        padding: 1rem !important;
    }
    
    .modal-card {
        max-width: 100% !important;
        width: 100% !important;
    }
}
