/* ============================================================
   StudioMusic.AI
   STYLE.CSS
   Versão corrigida
   - Interface escura e responsiva
   - Menu lateral
   - Formulário de geração
   - Cartões de músicas
   - Player de áudio
   - Menu do utilizador
============================================================ */

/* ============================================================
   1. VARIÁVEIS E RESET
============================================================ */

:root {
    --bg-primary: #090b10;
    --bg-secondary: #10131a;
    --card-bg: #12161e;

    --border: #252b36;
    --border-light: #343b49;

    --text-primary: #ffffff;
    --text-secondary: #c4c9d2;
    --text-muted: #a7adb8;

    --accent: #ff6b00;
    --accent-hover: #ff8126;

    --danger: #ff4d5a;
    --success: #27c77a;
    --warning: #ffb020;
}

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

html {
    width: 100%;
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    min-height: 100vh;

    background:
        radial-gradient(
            circle at top,
            rgba(255, 107, 0, 0.10),
            transparent 35%
        ),
        var(--bg-primary);

    color: var(--text-primary);

    font-family:
        Inter,
        Arial,
        Helvetica,
        sans-serif;

    -webkit-font-smoothing: antialiased;

    overflow-x: hidden;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(255, 107, 0, 0.35);
    outline-offset: 2px;
}

a {
    color: inherit;
}

.hidden {
    display: none !important;
}


/* ============================================================
   2. SIDEBAR
============================================================ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;

    display: flex;
    flex-direction: column;

    width: 300px;
    height: 100vh;
    height: 100dvh;

    background: rgba(18, 22, 30, 0.98);

    border-right: 1px solid var(--border);

    z-index: 2000;

    transform: translateX(-100%);

    transition:
        transform 0.28s ease,
        box-shadow 0.28s ease;

    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.25);
}

.sidebar.open {
    transform: translateX(0);
}


/* ============================================================
   3. CABEÇALHO DA SIDEBAR
============================================================ */

.sidebar-header {
    min-height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 18px;

    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;

    min-width: 0;
}

.brand-icon {
    width: 42px;
    height: 42px;

    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: var(--accent);
    color: #ffffff;

    font-size: 24px;

    box-shadow:
        0 8px 25px rgba(255, 107, 0, 0.25);
}

.brand-icon .material-icons {
    font-size: 28px;
    color: #ffffff;
}

.brand-text {
    color: #ffffff;

    font-size: 20px;
    font-weight: 700;
}

.brand-text span {
    color: var(--accent);
}

.sidebar-close {
    width: 42px;
    height: 42px;

    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: transparent;
    color: var(--text-secondary);

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--danger);
}


/* ============================================================
   4. NAVEGAÇÃO
============================================================ */

.sidebar-nav {
    flex: 1;

    padding: 18px 12px;

    overflow-y: auto;
}

.nav-item {
    width: 100%;
    min-height: 52px;

    display: flex;
    align-items: center;

    gap: 14px;

    padding: 0 16px;
    margin-bottom: 6px;

    border-radius: 12px;

    background: transparent;
    color: var(--text-muted);

    text-align: left;

    font-size: 15px;
    font-weight: 600;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.nav-item:active {
    transform: scale(0.98);
}

.nav-item.active {
    background: rgba(255, 107, 0, 0.12);
    color: var(--accent);
}

.nav-item .material-icons {
    font-size: 22px;
}


/* ============================================================
   5. RODAPÉ DA SIDEBAR
============================================================ */

.sidebar-footer {
    padding: 16px;

    border-top: 1px solid var(--border);
}

.api-status {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 12px;

    border-radius: 12px;

    background: #191e27;
}

.api-status small {
    display: block;

    margin-bottom: 2px;

    font-size: 11px;
    color: var(--text-muted);
}

.api-status strong {
    font-size: 13px;
    color: #ffffff;
}

.status-dot {
    width: 10px;
    height: 10px;

    flex: 0 0 auto;

    border-radius: 50%;

    background: #9aa0a6;
}

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

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


/* ============================================================
   6. SOBREPOSIÇÃO DO MENU
============================================================ */

.menu-overlay {
    position: fixed;
    inset: 0;

    z-index: 1900;

    background: rgba(0, 0, 0, 0.60);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.28s ease,
        visibility 0.28s ease;

    backdrop-filter: blur(2px);
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* ============================================================
   7. CONTEÚDO PRINCIPAL
============================================================ */

.main-content {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;

    margin-left: 0;

    background:
        radial-gradient(
            circle at top,
            rgba(255, 107, 0, 0.07),
            transparent 35%
        ),
        var(--bg-primary);

    transition: margin-left 0.28s ease;
}

.content {
    width: 100%;
    max-width: 1400px;

    margin: 0 auto;
    padding: 32px;
}


/* ============================================================
   8. TOPBAR
============================================================ */

.topbar {
    position: sticky;
    top: 0;

    width: 100%;
    min-height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    padding: 0 22px;

    background: rgba(18, 22, 30, 0.96);

    border-bottom: 1px solid var(--border);

    backdrop-filter: blur(12px);

    z-index: 1000;
}

.topbar-left {
    display: flex;
    align-items: center;

    gap: 14px;

    min-width: 0;
}

.menu-button {
    width: 44px;
    height: 44px;

    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background: transparent;
    color: #f1f3f4;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease;
}

.menu-button:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent);
}

.menu-button:active {
    transform: scale(0.94);
}

.menu-button .material-icons {
    font-size: 26px;
}

.topbar-title {
    min-width: 0;

    font-size: 18px;
    font-weight: 700;

    color: #f1f5f9;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-right {
    display: flex;
    align-items: center;

    gap: 8px;

    min-width: 0;
}

.icon-button {
    width: 42px;
    height: 42px;

    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: transparent;
    color: var(--text-secondary);

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent);
}


/* ============================================================
   9. PÁGINAS
============================================================ */

.page {
    display: none;
    animation: pageFade 0.25s ease;
}

.page.active {
    display: block;
}

@keyframes pageFade {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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


/* ============================================================
   10. CABEÇALHO DAS PÁGINAS
============================================================ */

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 26px;
}

.page-header h1 {
    margin-bottom: 8px;

    font-size: 30px;
    line-height: 1.2;

    color: #ffffff;
}

.page-header p {
    color: var(--text-muted);

    font-size: 15px;
    line-height: 1.6;
}


/* ============================================================
   11. CARTÃO DO FORMULÁRIO DE GERAÇÃO
============================================================ */

.music-form-card {
    width: 100%;
    max-width: 950px;

    margin: 0 auto;
    padding: 30px;

    background: var(--card-bg);

    border: 1px solid var(--border-light);
    border-radius: 18px;

    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}


/* ============================================================
   12. FORMULÁRIO
============================================================ */

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;

    margin-bottom: 9px;

    font-size: 14px;
    font-weight: 700;

    color: #e4e8ef;
}

.optional {
    color: var(--text-muted);
    font-weight: 400;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;
}

.character-counter {
    font-size: 12px;
    color: var(--text-muted);
}

input[type="text"],
input[type="search"],
select,
textarea {
    width: 100%;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: #0c0f15;
    color: #ffffff;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

input[type="text"],
input[type="search"],
select {
    height: 48px;
    padding: 0 14px;
}

textarea {
    min-height: 170px;

    padding: 14px;

    resize: vertical;

    line-height: 1.6;
}

input[type="text"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);

    box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.10);

    outline: none;
}

textarea::placeholder,
input::placeholder {
    color: #858d9b;
}

select option {
    background: #12161e;
    color: #ffffff;
}

.field-help {
    margin-top: 8px;

    font-size: 12px;
    line-height: 1.5;

    color: var(--text-muted);
}


/* ============================================================
   13. GRELHA DO FORMULÁRIO
============================================================ */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 20px;
}


/* ============================================================
   14. SWITCH
============================================================ */

.switch-container {
    min-height: 48px;

    display: flex;
    align-items: center;

    gap: 12px;

    color: #ced5df;
    font-size: 14px;
}

.switch {
    position: relative;

    display: inline-block;

    width: 48px;
    height: 28px;

    flex: 0 0 auto;
}

.switch input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
}

.slider {
    position: absolute;
    inset: 0;

    cursor: pointer;

    border-radius: 30px;

    background: #555d69;

    transition: background 0.25s ease;
}

.slider::before {
    content: "";

    position: absolute;

    width: 22px;
    height: 22px;

    left: 3px;
    top: 3px;

    border-radius: 50%;

    background: #ffffff;

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);

    transition: transform 0.25s ease;
}

.switch input:checked + .slider {
    background: var(--accent);
}

.switch input:checked + .slider::before {
    transform: translateX(20px);
}

.switch input:focus-visible + .slider {
    outline: 3px solid rgba(255, 107, 0, 0.35);
    outline-offset: 3px;
}


/* ============================================================
   15. BOTÕES GERAIS
============================================================ */

.primary-button,
.secondary-button {
    min-height: 46px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    padding: 0 18px;

    border-radius: 11px;

    font-size: 14px;
    font-weight: 700;

    text-decoration: none;

    transition:
        transform 0.15s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.primary-button {
    background: var(--accent);
    color: #ffffff;

    box-shadow: 0 5px 16px rgba(255, 107, 0, 0.22);
}

.primary-button:hover {
    background: var(--accent-hover);

    box-shadow: 0 7px 20px rgba(255, 107, 0, 0.28);
}

.secondary-button {
    background: #252b36;
    color: #ffffff;

    border: 1px solid #343b49;
}

.secondary-button:hover {
    background: #303744;
}

.primary-button:active,
.secondary-button:active {
    transform: scale(0.97);
}

.primary-button:disabled,
.secondary-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.generate-area {
    display: flex;
    justify-content: flex-end;

    margin-top: 8px;
}

.generate-button {
    min-width: 190px;
}


/* ============================================================
   16. ESTADO DE GERAÇÃO
============================================================ */

.generation-status {
    display: flex;
    align-items: center;

    gap: 16px;

    margin-top: 24px;
    padding: 18px;

    border-radius: 14px;

    background: #191e27;
    border: 1px solid #343b49;
}

.generation-status strong {
    display: block;

    margin-bottom: 4px;

    color: #ffffff;
}

.generation-status p {
    color: var(--text-secondary);

    font-size: 13px;
    line-height: 1.5;
}

.loading-spinner {
    width: 28px;
    height: 28px;

    flex: 0 0 auto;

    border: 3px solid rgba(255, 107, 0, 0.20);
    border-top-color: var(--accent);

    border-radius: 50%;

    animation: spin 0.8s linear infinite;
}

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


/* ============================================================
   17. PLAYER DE ÁUDIO
============================================================ */

.audio-player-container {
    margin-top: 24px;
    padding: 20px;

    border-radius: 16px;

    background: var(--card-bg);
    border: 1px solid var(--border);
}

.player-header {
    display: flex;
    align-items: center;

    gap: 14px;

    margin-bottom: 18px;
}

.player-icon {
    width: 48px;
    height: 48px;

    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: var(--accent);
    color: #ffffff;
}

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

.player-info strong {
    display: block;

    margin-bottom: 4px;

    color: #ffffff;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-info span {
    font-size: 12px;
    color: var(--text-muted);
}

.audio-player-container audio {
    display: block;
    width: 100%;
    max-width: 100%;
}

.player-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;

    gap: 10px;

    margin-top: 14px;
}


/* ============================================================
   18. BOTÃO DE ELIMINAR
============================================================ */

.danger-button {
    min-height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    padding: 0 14px;

    border: 1px solid rgba(255, 77, 90, 0.25);
    border-radius: 10px;

    background: rgba(255, 77, 90, 0.10);
    color: #ff7b85;

    font-size: 13px;
    font-weight: 600;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.danger-button:hover {
    background: rgba(255, 77, 90, 0.18);
    color: #ff9ba2;
}


/* ============================================================
   19. PESQUISA
============================================================ */

.search-box {
    position: relative;

    width: 100%;
    max-width: 600px;

    margin-bottom: 24px;
}

.search-box .material-icons {
    position: absolute;

    left: 14px;
    top: 50%;

    transform: translateY(-50%);

    color: var(--text-muted);

    pointer-events: none;
}

.search-box input {
    padding-left: 46px;
}


/* ============================================================
   20. LISTA DE MÚSICAS
============================================================ */

.songs-list {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(min(100%, 300px), 1fr));

    gap: 18px;

    width: 100%;
    min-width: 0;
}


/* ============================================================
   21. CARTÕES DE MÚSICA
============================================================ */

.songs-list .song-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;

    gap: 14px;

    width: 100%;
    min-width: 0;

    padding: 16px;

    overflow: hidden;

    background: var(--card-bg);
    color: var(--text-primary);

    border: 1px solid var(--border);
    border-radius: 16px;

    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.songs-list .song-card:hover {
    transform: translateY(-2px);

    border-color: #3c4555;

    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.20);
}


/* ============================================================
   22. CAPA DO CARTÃO
============================================================ */

.songs-list .song-card .song-card-icon {
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 10px;

    width: 100%;
    height: 160px;
    min-width: 0;

    flex-shrink: 0;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 30% 20%,
            rgba(255, 107, 0, 0.18),
            transparent 65%
        ),
        #191e27;

    color: #ffffff;

    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.songs-list .song-card .song-cover {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    border-radius: inherit;
}

/* Ícone de substituição da capa */

.songs-list .song-card .song-cover-fallback {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    background:
        radial-gradient(
            circle at top,
            rgba(255, 107, 0, 0.18),
            transparent 70%
        ),
        #191e27;

    color: #d9dee7;

    font-size: 36px;
}

/* Símbolo da marca, caso seja utilizado pelo HTML */

.songs-list .song-card .song-cover-symbol {
    font-size: 42px;
    line-height: 1;
    color: var(--accent);
}

.songs-list .song-card .song-card-brand {
    max-width: 100%;

    padding: 0 12px;

    color: #ffffff;

    font-size: 18px;
    font-weight: 700;

    text-align: center;
    overflow-wrap: anywhere;
}


/* ============================================================
   23. INFORMAÇÕES DA MÚSICA
============================================================ */

.songs-list .song-card .song-card-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    gap: 7px;

    width: 100%;
    min-width: 0;

    overflow: visible;
    overflow-wrap: anywhere;

    color: var(--text-primary);
}

/* TÍTULO DA MÚSICA */

.songs-list .song-card .song-card-info h3 {
    display: block !important;

    width: 100%;
    height: auto;

    margin: 0 0 4px;

    color: #ffffff !important;

    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;

    text-align: left;

    visibility: visible !important;
    opacity: 1 !important;

    white-space: normal;

    overflow: visible;
    overflow-wrap: anywhere;
    word-break: normal;
}

/* Parágrafos gerais das informações */

.songs-list .song-card .song-card-info p {
    max-width: 100%;
    margin: 0;

    color: var(--text-secondary);

    font-size: 13px;
    line-height: 1.5;

    overflow-wrap: anywhere;
}

/* DURAÇÃO */

.songs-list .song-card .song-card-duration {
    display: flex;

    align-items: center;
    flex-wrap: wrap;

    gap: 5px;

    margin: 0;

    color: #c4c9d2 !important;

    font-size: 12px !important;
    font-weight: 400;

    line-height: 1.6;
}

.songs-list .song-card .song-card-duration .material-icons {
    flex: 0 0 auto;

    color: #c4c9d2 !important;

    font-size: 15px;
}

/* DATA */

.songs-list .song-card .song-card-date {
    display: block !important;

    width: 100%;
    max-width: 100%;

    margin: 0;

    color: #b0b7c3 !important;

    font-size: 11px !important;
    font-weight: 400;

    line-height: 1.6;

    visibility: visible !important;
    opacity: 1 !important;

    overflow-wrap: anywhere;
}

/* Elementos small dentro das informações */

.songs-list .song-card .song-card-info small {
    color: #b0b7c3;
    font-size: 11px;
    line-height: 1.6;
}


/* ============================================================
   24. AÇÕES DOS CARTÕES
============================================================ */

.songs-list .song-card .song-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;

    flex-wrap: wrap;

    gap: 8px;

    width: 100%;
    min-width: 0;

    margin-top: 2px;
}

.songs-list .song-card .song-card-actions button,
.songs-list .song-card .song-card-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    min-height: 38px;
    max-width: 100%;

    flex: 0 1 auto;

    padding: 0 11px;

    border-radius: 9px;

    font-size: 12px;
    font-weight: 600;

    text-decoration: none;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.songs-list .song-card .song-card-actions .material-icons {
    font-size: 18px;
}

/* Botões normais */

.songs-list .song-card .song-card-actions button {
    background: #252b36;
    color: #e8edf5;

    border: 1px solid #343b49;
}

.songs-list .song-card .song-card-actions button:hover {
    background: #343b49;
    color: #ffffff;
}

/* Links, incluindo transferência */

.songs-list .song-card .song-card-actions a {
    background: rgba(255, 107, 0, 0.12);
    color: #ff974d;

    border: 1px solid rgba(255, 107, 0, 0.22);
}

.songs-list .song-card .song-card-actions a:hover {
    background: rgba(255, 107, 0, 0.20);
    color: #ffb37a;
}

/* Botões de eliminar */

.songs-list .song-card .song-card-actions .danger-button {
    background: rgba(255, 77, 90, 0.10);
    color: #ff7b85;

    border-color: rgba(255, 77, 90, 0.25);
}

.songs-list .song-card .song-card-actions .danger-button:hover {
    background: rgba(255, 77, 90, 0.20);
    color: #ffabb1;
}


/* ============================================================
   25. ESTADOS VAZIOS
============================================================ */

.empty-state {
    width: 100%;

    padding: 60px 20px;

    text-align: center;

    color: var(--text-muted);
}

.empty-state .material-icons {
    display: block;

    margin-bottom: 12px;

    font-size: 48px;
    color: #687181;
}

.empty-state h3 {
    margin-bottom: 8px;

    color: #e8edf5;
    font-size: 18px;
}

.empty-state p {
    color: var(--text-muted);

    font-size: 14px;
    line-height: 1.6;
}


/* ============================================================
   26. NOTIFICAÇÕES TOAST
============================================================ */

.toast {
    position: fixed;

    right: 22px;
    bottom: 22px;

    max-width: min(400px, calc(100vw - 44px));
    min-height: 50px;

    display: flex;
    align-items: center;

    gap: 10px;

    padding: 12px 16px;

    border: 1px solid #343b49;
    border-radius: 12px;

    background: #191e27;
    color: #ffffff;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.30);

    z-index: 5000;

    opacity: 0;
    visibility: hidden;

    transform: translateY(12px);

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease;
}

.toast.show {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
}

.toast .material-icons {
    flex: 0 0 auto;
    color: #ffb37a;
}


/* ============================================================
   27. MENU DO UTILIZADOR
============================================================ */

.user-menu-container {
    position: relative;

    display: inline-block;

    flex: 0 0 auto;
}

/* Botão do perfil */

.user-menu-button {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    padding: 6px 10px;

    border: 1px solid transparent;
    border-radius: 8px;

    background: transparent;
    color: #e8edf5;

    cursor: pointer;

    font-family: inherit;
    font-size: 14px;
    font-weight: 500;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.user-menu-button:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-light);
}

.user-menu-button .material-icons {
    flex: 0 0 auto;
    font-size: 22px;
}

.user-name {
    display: inline-block;

    max-width: 120px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Menu suspenso */

.user-dropdown {
    position: absolute;

    top: calc(100% + 8px);
    right: 0;

    display: flex;
    flex-direction: column;

    min-width: 180px;

    padding: 6px;

    background: #191e27;

    border: 1px solid #343b49;
    border-radius: 10px;

    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.30);

    z-index: 3000;

    animation: dropdownFadeIn 0.15s ease-out;
}

.user-dropdown.hidden {
    display: none !important;
}

/* Opções do menu */

.dropdown-item {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 10px 12px;

    border-radius: 6px;

    background: transparent;
    color: #e8edf5;

    font-size: 14px;
    font-weight: 500;

    text-decoration: none;

    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.dropdown-item .material-icons {
    font-size: 20px;
    color: #a7adb8;
}

.dropdown-item:hover {
    background: #252b36;
    color: #ffffff;
}

.dropdown-item:hover .material-icons {
    color: #ffffff;
}

/* Terminar sessão */

.logout-item {
    color: #ff7b85;
}

.logout-item .material-icons {
    color: #ff7b85;
}

.logout-item:hover {
    background: rgba(255, 77, 90, 0.12);
    color: #ffabb1;
}

.logout-item:hover .material-icons {
    color: #ffabb1;
}

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

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


/* =========================================================
   CAMPO DE LETRA — StudioMusic.AI
   ========================================================= */

.lyrics-group {
    width: 100%;
    margin: 22px 0;
    padding: 18px;
    background: #181818;
    border: 1px solid #333333;
    border-radius: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.lyrics-group:focus-within {
    border-color: #ff6b00;
}

/* Cabeçalho */

.lyrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.lyrics-header label {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
}

.lyrics-header label .material-icons {
    color: #ff6b00;
    font-size: 22px;
}

.lyrics-counter {
    color: #a0a0a0;
    font-size: 12px;
    white-space: nowrap;
}

/* Área de texto */

.lyrics-textarea {
    display: block;
    width: 100%;
    min-height: 240px;
    padding: 16px;
    box-sizing: border-box;

    background: #101010;
    color: #f1f1f1;

    border: 1px solid #383838;
    border-radius: 10px;
    outline: none;

    font-family: inherit;
    font-size: 14px;
    line-height: 1.8;

    resize: vertical;
    overflow-y: auto;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.lyrics-textarea::placeholder {
    color: #777777;
    opacity: 1;
}

.lyrics-textarea:focus {
    border-color: #ff6b00;
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.12);
}

/* Rodapé */

.lyrics-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.lyrics-help {
    color: #999999;
    font-size: 12px;
    line-height: 1.5;
}

.lyrics-clear-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    padding: 8px 12px;
    background: transparent;
    color: #ff8a50;

    border: 1px solid #66391f;
    border-radius: 8px;

    font-size: 12px;
    font-weight: 500;
    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.lyrics-clear-btn:hover {
    background: rgba(255, 107, 0, 0.1);
    border-color: #ff6b00;
}

.lyrics-clear-btn .material-icons {
    font-size: 18px;
}

/* Responsividade */

@media (max-width: 600px) {
    .lyrics-group {
        padding: 13px;
        margin: 16px 0;
        border-radius: 11px;
    }

    .lyrics-header {
        align-items: flex-start;
    }

    .lyrics-header label {
        font-size: 14px;
    }

    .lyrics-counter {
        font-size: 11px;
    }

    .lyrics-textarea {
        min-height: 210px;
        padding: 12px;
        font-size: 14px;
    }

    .lyrics-footer {
        align-items: flex-start;
    }

    .lyrics-help {
        flex: 1 1 100%;
    }
}

/* ============================================================
   28. TABLETS
============================================================ */

@media (max-width: 1024px) {
    .sidebar {
        width: 290px;
    }

    .content {
        padding: 26px;
    }

    .music-form-card {
        padding: 26px;
    }

    .songs-list {
        grid-template-columns:
            repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    }
}


/* ============================================================
   29. TELEMÓVEIS
============================================================ */

@media (max-width: 768px) {
    .topbar {
        min-height: 64px;
        padding: 0 14px;
    }

    .topbar-left {
        gap: 8px;
    }

    .topbar-title {
        font-size: 16px;
    }

    .content {
        padding: 20px 14px;
    }

    .page-header {
        flex-direction: column;
        gap: 10px;

        margin-bottom: 20px;
    }

    .page-header h1 {
        font-size: 26px;
    }

    .page-header p {
        font-size: 14px;
    }

    .music-form-card {
        padding: 20px;
        border-radius: 15px;
    }

    .form-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .generate-area {
        justify-content: stretch;
    }

    .generate-button {
        width: 100%;
    }

    .songs-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .songs-list .song-card {
        padding: 14px;
    }

    .songs-list .song-card .song-card-icon {
        height: 150px;
    }

    .songs-list .song-card .song-card-info h3 {
        font-size: 19px !important;
    }

    .player-actions {
        justify-content: flex-start;
    }
}


/* ============================================================
   30. TELEMÓVEIS PEQUENOS
============================================================ */

@media (max-width: 480px) {
    .sidebar {
        width: min(300px, 88vw);
    }

    .sidebar-header {
        padding: 0 14px;
    }

    .content {
        padding: 18px 12px;
    }

    .topbar {
        padding: 0 10px;
    }

    .topbar-title {
        font-size: 15px;
    }

    .menu-button {
        width: 40px;
        height: 40px;
    }

    .topbar-right {
        gap: 2px;
    }

    .user-menu-button {
        gap: 4px;
        padding: 6px;
    }

    .user-name {
        max-width: 75px;
        font-size: 12px;
    }

    .user-menu-button .material-icons {
        font-size: 20px;
    }

    .icon-button {
        width: 36px;
        height: 36px;
    }

    .music-form-card {
        padding: 16px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .page-header p {
        font-size: 14px;
    }

    textarea {
        min-height: 150px;
    }

    .songs-list .song-card {
        gap: 12px;
        padding: 12px;
    }

    .songs-list .song-card .song-card-icon {
        height: 140px;
    }

    .songs-list .song-card .song-card-info h3 {
        font-size: 18px !important;
    }

    .songs-list .song-card .song-card-duration {
        font-size: 12px !important;
    }

    .songs-list .song-card .song-card-date {
        font-size: 11px !important;
    }

    .songs-list .song-card .song-card-actions {
        gap: 6px;
    }

    .songs-list .song-card .song-card-actions button,
    .songs-list .song-card .song-card-actions a {
        min-height: 36px;
        padding: 0 9px;
        font-size: 11px;
    }

    .toast {
        right: 12px;
        bottom: 12px;

        max-width: calc(100vw - 24px);
    }

    .audio-player-container {
        padding: 14px;
    }

    .player-header {
        gap: 10px;
    }

    .player-icon {
        width: 42px;
        height: 42px;
    }
}


/* ============================================================
   31. TELEMÓVEIS NA HORIZONTAL
============================================================ */

@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        width: 280px;
    }

    .sidebar-header {
        min-height: 60px;
    }

    .sidebar-nav {
        padding: 10px 12px;
    }

    .nav-item {
        min-height: 44px;
    }

    .content {
        padding: 18px;
    }

    .music-form-card {
        padding: 18px;
    }

    textarea {
        min-height: 120px;
    }
}


/* ============================================================
   32. REDUÇÃO DE MOVIMENTO
============================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;

        transition-duration: 0.01ms !important;
    }
}