:root {
    --verde-floresta: #0F3D37;
    --ouro-samba: #C89D3A;
    --carvao: #222222;
    --bruma: #E8E6E2;
    --papel: #FAFAF9;
    
    --bg-body: var(--bruma);
    --card-bg: var(--papel);
    --card-border: rgba(15, 61, 55, 0.08);
    --card-hover-border: var(--ouro-samba);
    
    --primary-grad: linear-gradient(135deg, var(--verde-floresta) 0%, #092622 100%);
    --primary-color: var(--verde-floresta);
    --primary-hover: #092622;
    
    --accent-color: var(--ouro-samba);
    --accent-hover: #b0872e;
    
    --text-main: var(--carvao);
    --text-muted: #555555;
    --text-dim: #7f8c8d;
    --text-on-primary: var(--papel);
    
    --success: #2e7d32;
    --warning: #f57c00;
    --danger: #d32f2f;
    --info: #0288d1;
    
    --font-sans: 'Plus Jakarta Sans', 'Outfit', system-ui, -apple-system, sans-serif;
    --transition-speed: 0.25s;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Background Glowing Gradients (Soft green and gold) */
.bg-gradient {
    position: fixed;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
    z-index: -1;
    pointer-events: none;
}
.bg-gradient-1 {
    top: -20vw;
    left: -20vw;
    background: radial-gradient(circle, var(--verde-floresta) 0%, transparent 70%);
}
.bg-gradient-2 {
    bottom: -20vw;
    right: -20vw;
    background: radial-gradient(circle, var(--ouro-samba) 0%, transparent 70%);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}
::-webkit-scrollbar-thumb {
    background: rgba(15, 61, 55, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 61, 55, 0.4);
}

/* App Layout */
.app-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header styling (Translucent Light Papel background to make green/gold logo visible) */
.main-header {
    background: rgba(250, 250, 249, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(15, 61, 55, 0.08);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 28px;
    position: sticky;
    top: 20px;
    z-index: 100;
    box-shadow: 0 10px 30px -10px rgba(15, 61, 55, 0.1);
    color: var(--text-main);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-img {
    height: 52px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(15, 61, 55, 0.05));
}

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

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.btn-primary {
    background: var(--verde-floresta);
    color: var(--papel);
    box-shadow: 0 4px 12px 0 rgba(15, 61, 55, 0.15);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px 0 rgba(15, 61, 55, 0.25);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(15, 61, 55, 0.05);
    color: var(--verde-floresta);
    border: 1px solid rgba(15, 61, 55, 0.1);
}
.btn-secondary:hover {
    background: rgba(15, 61, 55, 0.1);
    border-color: rgba(15, 61, 55, 0.2);
}

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

.btn-icon {
    background: rgba(15, 61, 55, 0.05);
    border: 1px solid rgba(15, 61, 55, 0.1);
    color: var(--verde-floresta);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed);
}
.btn-icon:hover {
    background: rgba(15, 61, 55, 0.1);
    border-color: rgba(15, 61, 55, 0.2);
}
.btn-icon i {
    width: 20px;
    height: 20px;
}

/* Segmented Control (Tabs inside Light Header) */
.genre-selector-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}
.genre-selector {
    background: rgba(15, 61, 55, 0.04);
    border: 1px solid rgba(15, 61, 55, 0.08);
    padding: 4px;
    border-radius: var(--radius-md);
    display: flex;
    width: 100%;
    max-width: 400px;
}
.genre-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: rgba(15, 61, 55, 0.65);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-speed);
}
.genre-btn.active {
    background: var(--verde-floresta);
    color: var(--papel);
    box-shadow: 0 4px 10px rgba(15, 61, 55, 0.15);
}
.genre-btn i {
    width: 18px;
    height: 18px;
}

/* Search bar inside header */
.search-container {
    position: relative;
    width: 100%;
}
.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
    width: 20px;
    height: 20px;
    pointer-events: none;
}
#search-input {
    width: 100%;
    background: rgba(15, 61, 55, 0.04);
    border: 1px solid rgba(15, 61, 55, 0.08);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 1rem;
    padding: 14px 16px 14px 48px;
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-speed);
}
#search-input:focus {
    border-color: var(--ouro-samba);
    background: rgba(15, 61, 55, 0.08);
    box-shadow: 0 0 0 4px rgba(200, 157, 58, 0.15);
}
#search-input::placeholder {
    color: #7f8c8d;
}
.clear-search-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.clear-search-btn:hover {
    color: var(--text-main);
}
.clear-search-btn i {
    width: 18px;
    height: 18px;
}

/* Main Content area */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.songs-summary {
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
    padding-left: 4px;
}

/* List layout */
.song-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 40px;
}

.song-list-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(15, 61, 55, 0.02);
}
.song-list-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--verde-floresta) 0%, var(--ouro-samba) 100%);
    opacity: 0;
    transition: opacity var(--transition-speed);
}
.song-list-item:hover {
    transform: translateX(4px);
    border-color: var(--card-hover-border);
    box-shadow: 0 6px 16px rgba(15, 61, 55, 0.1);
}
.song-list-item:hover::before {
    opacity: 1;
}

.item-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.song-icon-wrapper {
    background: rgba(15, 61, 55, 0.06);
    border: 1px solid rgba(15, 61, 55, 0.1);
    color: var(--verde-floresta);
    padding: 8px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.song-icon-wrapper i {
    width: 20px;
    height: 20px;
}

.song-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap;
}

.song-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-separator {
    color: var(--ouro-samba);
    font-weight: 700;
}

.song-author {
    font-size: 0.92rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.file-size {
    font-size: 0.78rem;
    color: var(--text-dim);
    font-weight: 500;
}
.card-btns {
    display: flex;
    gap: 8px;
}
.card-btn {
    background: rgba(15, 61, 55, 0.04);
    border: 1px solid rgba(15, 61, 55, 0.08);
    color: var(--text-muted);
    padding: 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
}
.card-btn:hover {
    background: rgba(15, 61, 55, 0.1);
    color: var(--verde-floresta);
    border-color: rgba(15, 61, 55, 0.2);
}
.card-btn-danger:hover {
    background: rgba(211, 47, 47, 0.08);
    border-color: rgba(211, 47, 47, 0.2);
    color: var(--danger) !important;
}
.card-btn i {
    width: 16px;
    height: 16px;
}

/* Skeleton Loading Animation */
.skeleton-card {
    height: 140px;
    background: linear-gradient(90deg, rgba(232, 230, 226, 0.5) 25%, rgba(250, 250, 249, 0.8) 50%, rgba(232, 230, 226, 0.5) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
}
@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}
.empty-logo-img {
    width: 100px;
    height: 100px;
    opacity: 0.15;
    margin-bottom: 20px;
    object-fit: contain;
}
.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}
.empty-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Modals Overlay Base */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(34, 34, 34, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.2s ease;
    padding: 16px;
}
.modal-overlay.hidden {
    display: none !important;
    opacity: 0;
}

/* Modal Card (Papel background with Forest Green Header) */
.modal-card {
    background: var(--papel);
    border: 1px solid rgba(15, 61, 55, 0.1);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(15, 61, 55, 0.15);
    display: flex;
    flex-direction: column;
    animation: modalSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--carvao);
}
@keyframes modalSlide {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-card-alert {
    border-color: rgba(245, 124, 0, 0.3);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(15, 61, 55, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--verde-floresta);
}
.modal-header .btn-icon {
    background: rgba(15, 61, 55, 0.05);
    border: 1px solid rgba(15, 61, 55, 0.1);
    color: var(--verde-floresta);
}
.modal-header .btn-icon:hover {
    background: rgba(15, 61, 55, 0.1);
}
.alert-icon {
    color: var(--warning);
    width: 24px;
    height: 24px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: 60vh;
}
.modal-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}
.modal-desc strong {
    color: var(--verde-floresta);
}
.modal-desc code {
    background: rgba(15, 61, 55, 0.05);
    color: var(--verde-floresta);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: monospace;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(15, 61, 55, 0.08);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.modal-footer .btn-secondary {
    background: var(--bruma);
    color: var(--carvao);
    border-color: rgba(0,0,0,0.1);
}
.modal-footer .btn-secondary:hover {
    background: #dcdad5;
}

/* Drag and Drop Zone */
.upload-dropzone {
    border: 2px dashed rgba(15, 61, 55, 0.25);
    border-radius: var(--radius-md);
    padding: 36px 20px;
    text-align: center;
    background: rgba(15, 61, 55, 0.02);
    transition: all var(--transition-speed);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.upload-dropzone:hover, .upload-dropzone.dragover {
    border-color: var(--ouro-samba);
    background: rgba(200, 157, 58, 0.06);
}
.dropzone-icon {
    width: 48px;
    height: 48px;
    color: var(--verde-floresta);
}
.upload-dropzone p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Selected files list */
.selected-files-container {
    margin-top: 24px;
}
.selected-files-container h4 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--text-muted);
}
.files-list {
    list-style: none;
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid rgba(15, 61, 55, 0.1);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.02);
}
.files-list li {
    padding: 10px 14px;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(15, 61, 55, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
}
.files-list li:last-child {
    border-bottom: none;
}
.file-name-info {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 12px;
}
.btn-remove-file {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 2px;
}
.btn-remove-file:hover {
    color: var(--danger);
}
.btn-remove-file i {
    width: 16px;
    height: 16px;
}

/* Conflict resolution modal specifics */
.conflict-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
    margin-top: 14px;
}
.btn-full {
    width: 100%;
}
.conflict-list-wrapper {
    border: 1px solid rgba(15, 61, 55, 0.1);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.02);
    max-height: 220px;
    overflow-y: auto;
}
.conflict-list {
    list-style: none;
}
.conflict-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(15, 61, 55, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    color: var(--text-main);
}
.conflict-item:last-child {
    border-bottom: none;
}
.conflict-item label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.conflict-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--verde-floresta);
    cursor: pointer;
}

/* Progress card */
.progress-card {
    max-width: 400px;
    padding: 24px;
    text-align: center;
}
.progress-bar-container {
    height: 8px;
    background: rgba(15, 61, 55, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0 12px;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--verde-floresta) 0%, var(--ouro-samba) 100%);
    border-radius: 4px;
    transition: width 0.1s ease;
}
.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.current-file-text {
    font-size: 0.85rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* PDF Viewer Modal Styles (Musician Stage View - Dark Theme) */
/* Kept dark so the white page sheet music stands out comfortably on stage */
.pdf-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--carvao);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    animation: viewerEnter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes viewerEnter {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.viewer-header {
    background: rgba(15, 61, 55, 0.98);
    border-bottom: 1px solid rgba(250, 250, 249, 0.1);
    height: 70px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}
.viewer-header .btn-icon {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--papel);
}
.viewer-header .btn-icon:hover {
    background: rgba(255, 255, 255, 0.15);
}

.viewer-title-info {
    text-align: center;
    flex: 1;
    overflow: hidden;
    padding: 0 20px;
}
.viewer-title-info h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--papel);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.viewer-title-info p {
    font-size: 0.8rem;
    color: var(--ouro-samba);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

/* PDF Render Container */
.pdf-viewer-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #181818; /* Dark border shadow effect */
}

/* Tap regions for page turning */
.tap-area {
    position: absolute;
    top: 0;
    height: 100%;
    width: 20%;
    z-index: 5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    user-select: none;
}
.tap-area-left {
    left: 0;
}
.tap-area-right {
    right: 0;
}
.tap-area:active {
    opacity: 0.05;
    background: white;
}

.canvas-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 10px;
}
#pdf-canvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 0 35px rgba(0,0,0,0.6);
    background: var(--papel);
    border-radius: 4px;
    display: block;
}

/* Viewer Loading spinner */
.viewer-loading {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 8;
}
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--ouro-samba);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hide old floating viewer controls */
.viewer-controls {
    display: none !important;
}

/* Header controls within top bar */
.viewer-header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}
.viewer-header-controls .page-counter {
    color: var(--papel);
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 90px;
    text-align: center;
}
.viewer-header-controls .btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--papel);
}
.viewer-header-controls .btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Hidden elements */
.hidden {
    display: none !important;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
    width: 100%;
}
.toast {
    background: var(--papel);
    border: 1px solid rgba(15, 61, 55, 0.15);
    border-left: 5px solid var(--verde-floresta);
    color: var(--text-main);
    padding: 16px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(15, 61, 55, 0.12);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastEnter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.25s ease;
}
.toast-success { border-left-color: var(--success); }
.toast-warning { border-left-color: var(--warning); }
.toast-error { border-left-color: var(--danger); }

.toast-content {
    flex: 1;
    font-size: 0.88rem;
    line-height: 1.4;
    font-weight: 600;
}
@keyframes toastEnter {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsividade - Media Queries */
@media (max-width: 768px) {
    :root {
        --radius-lg: 12px;
        --radius-md: 10px;
    }
    
    .app-container {
        padding: 12px;
    }
    
    .main-header {
        padding: 16px;
        top: 12px;
        margin-bottom: 20px;
    }
    
    .header-top {
        margin-bottom: 16px;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    .logo-icon {
        width: 26px;
        height: 26px;
    }
    
    .btn span {
        display: none;
    }
    .btn {
        padding: 10px;
        width: 44px;
        height: 44px;
        border-radius: var(--radius-md);
    }
    .btn i {
        width: 20px;
        height: 20px;
    }
    
    .song-grid {
        gap: 8px;
    }
    .song-list-item {
        padding: 10px 14px;
    }
    .song-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    .song-separator {
        display: none;
    }
    .song-title {
        font-size: 0.95rem;
    }
    .song-author {
        font-size: 0.8rem;
    }
    .item-right {
        gap: 10px;
    }
    .file-size {
        display: none; /* Hide size on tiny mobile screens to save space */
    }
    
    .viewer-header {
        height: 54px;
        padding: 0 8px;
    }
    .viewer-title-info {
        display: none !important;
    }
    .viewer-header-controls {
        flex: 1;
        justify-content: center;
        gap: 8px;
    }
    .viewer-header-controls .page-counter {
        font-size: 0.82rem;
        min-width: 70px;
    }
    .viewer-header-controls .btn-icon {
        width: 32px;
        height: 32px;
    }
    .canvas-wrapper {
        display: block !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 8px 4px !important;
        text-align: center;
        -webkit-overflow-scrolling: touch;
    }
    #pdf-canvas {
        margin: 0 auto !important;
        max-width: 100% !important;
        height: auto !important;
    }
    .tap-area {
        width: 25%;
    }
}

@media (max-width: 480px) {
    .conflict-options {
        grid-template-columns: 1fr;
    }
}

/* Role Selection & Auth Overlay Styles */
.role-selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 61, 55, 0.4);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    transition: opacity 0.35s ease;
    padding: 20px;
}

.role-card {
    background: var(--papel);
    border: 1px solid rgba(15, 61, 55, 0.1);
    border-radius: 20px;
    padding: 36px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 24px 50px rgba(15, 61, 55, 0.18);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: modalSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.role-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}
.role-logo-img {
    height: 180px;
    width: auto;
    object-fit: contain;
}
.role-icon-img {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.role-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--verde-floresta);
}

.role-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.4;
}

.role-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.btn-role {
    background: var(--papel);
    border: 1px solid rgba(15, 61, 55, 0.1);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-speed);
}

.btn-role i {
    width: 24px;
    height: 24px;
    color: var(--verde-floresta);
    flex-shrink: 0;
}

.btn-role-visitor:hover {
    border-color: var(--verde-floresta);
    background: rgba(15, 61, 55, 0.04);
    transform: translateY(-2px);
}

.btn-role-admin:hover {
    border-color: var(--ouro-samba);
    background: rgba(200, 157, 58, 0.06);
    transform: translateY(-2px);
}

.btn-role-admin i {
    color: var(--ouro-samba);
}

.role-btn-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.role-btn-text strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}
.role-btn-text span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Admin Login Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
    margin-top: 8px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--verde-floresta);
}
.form-group input {
    background: rgba(15, 61, 55, 0.03);
    border: 1px solid rgba(15, 61, 55, 0.1);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition-speed);
}
.form-group input:focus {
    border-color: var(--ouro-samba);
    background: rgba(15, 61, 55, 0.06);
}

.login-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}
.login-actions .btn {
    padding: 12px;
}
.login-actions .btn-secondary {
    background: var(--bruma);
    color: var(--carvao);
    border-color: rgba(0,0,0,0.1);
}
.login-actions .btn-secondary:hover {
    background: #dcdad5;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

