/* Catálogos 4tex */
/* Sistema de gerenciamento de arquivos PDF */
/* Desenvolvido por: Milo Moskorz */
/* Para: 4tex */

/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: museo, Montserrat, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    background: radial-gradient(1100px 760px at 80% -10%, #1a2136 0%, var(--bg) 60%) fixed;
    color: var(--ink);
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(1000px 600px at 100% 0%, rgba(106,168,255,.12), transparent 60%),
        radial-gradient(900px 540px at 10% 90%, rgba(77,225,193,.10), transparent 60%);
}

/* Variáveis CSS - Baseadas na página de referência 4tex */
:root {
    /* Cores de fundo */
    --bg: #0b0f16;
    --bg-2: #111624;
    --ink: #e8ecf5;
    --ink-dim: #c6cddd;
    
    /* Tema claro */
    --bgL: #f6f8fc;
    --inkL: #0c111b;
    --inkL-dim: #3a4458;
    
    /* Cores de destaque */
    --a1: #4de1c1;
    --a2: #6aa8ff;
    --a3: #ff7a59;
    --a4: #9d7bff;
    
    /* Gradientes */
    --g1: linear-gradient(135deg, #4de1c1, #6aa8ff);
    --g2: linear-gradient(135deg, #ff7a59, #9d7bff);
    
    /* Tipografia responsiva */
    --fz-1: clamp(16px, 1vw + 12px, 18px);
    --fz-2: clamp(18px, 1.2vw + 12px, 22px);
    --fz-3: clamp(22px, 1.6vw + 12px, 30px);
    --fz-4: clamp(30px, 2.2vw + 12px, 46px);
    --fz-5: clamp(48px, 3.6vw + 12px, 86px);
    --fz-6: clamp(82px, 7.2vw + 12px, 156px);
    
    /* Espaçamento, raio e sombra */
    --pad: clamp(14px, 2.2vw, 40px);
    --radius: 18px;
    --shadow: 0 10px 30px rgba(0,0,0,.35);
    
    /* Transições */
    --t-1: 120ms;
    --t-2: 320ms;
    --t-3: 600ms;
    
    /* Compatibilidade com código existente */
    --primary-blue: var(--a2);
    --primary-orange: var(--a3);
    --dark-bg: var(--bg);
    --dark-bg-secondary: var(--bg-2);
    --dark-text: var(--ink);
    --dark-text-dim: var(--ink-dim);
    --light-bg: var(--bgL);
    --light-text: var(--inkL);
    --light-text-dim: var(--inkL-dim);
    --gray-100: #121212;
    --gray-200: #1e1e1e;
    --gray-300: #2c2c2c;
    --gray-400: #383838;
    --gray-500: #666666;
    --gray-600: #b3b3b3;
    --gray-700: #e8e8e8;
    --gray-800: #f0f0f0;
    --gray-900: #ffffff;
    --white: #121212;
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.6);
    --admin-color: #FF6B35;
    --success-color: #4CAF50;
    --warning-color: #FFC107;
    --error-color: #F44336;
    --light-blue: #1a2332;
    --light-orange: #2a1f1a;
    --dark-blue: #3d8bff;
    --dark-orange: #e55a2b;
    --footer-height: 72px;
    --gap-s: clamp(8px, 2vw, 12px);
    --gap-m: clamp(12px, 3vw, 18px);
    --gap-l: clamp(16px, 4vw, 24px);
    --gap-xl: clamp(20px, 5vw, 32px);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 clamp(14px, 2.2vw, 40px);
    background: linear-gradient(to bottom, rgba(10,14,24,.85), rgba(10,14,24,.25));
    backdrop-filter: saturate(115%) blur(12px);
    -webkit-backdrop-filter: saturate(115%) blur(12px);
    border-bottom: 1px solid rgba(255,255,255,.08);
    color: #e8ecf5;
    justify-content: space-between;
    box-shadow: var(--shadow);
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.logo img {
    height: 28px;
}

.logo .divider {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,.14);
}

.logo span {
    font-weight: 700;
    letter-spacing: .04em;
    font-size: 14px;
    opacity: .85;
}

.logo i {
    font-size: 24px;
    color: var(--primary-blue);
}

.logo h1 {
    font-family: 'museo', serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--gray-800);
    margin: 0 0 0 0;
}

.header-center {
    flex: 1;
    max-width: 600px;
    margin: 0 40px;
    display: flex;
    justify-content: center;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto var(--gap-l) auto;
    z-index: 5;
}

.search-container i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
    font-size: 16px;
}

.search-container input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 1px solid var(--gray-300);
    border-radius: 24px;
    font-size: 14px;
    background: var(--gray-100);
    transition: all 0.3s ease;
    color: var(--ink); /* Cor do texto para melhor contraste */
}

.search-container input::placeholder {
    color: var(--ink-dim); /* Cor do placeholder para melhor contraste */
    opacity: 0.7;
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: var(--gray-200);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.2);
}

/* Ajustes para dispositivos móveis */
@media (max-width: 768px) {
    .header-center {
        margin: 0 10px;
    }
    
    .search-container {
        position: relative;
        width: 100%;
    }
    
    .search-container input {
        padding: 8px 12px 8px 36px;
        font-size: 13px;
    }
    
    .search-container i {
        left: 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .header {
        height: auto;
        padding: 10px;
        flex-wrap: wrap;
    }
    
    .header-left {
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
    }
    
    .header-center {
        width: 100%;
        order: 3;
        margin: 8px 0 0 0;
    }
    
    .header-right {
        order: 2;
    }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-upload {
    background: var(--primary-blue);
    color: var(--gray-100);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-upload:hover {
    background: var(--dark-blue);
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.btn-admin {
    background: var(--admin-color);
    color: var(--gray-100);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-admin:hover {
    background: var(--dark-orange);
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

/* Breadcrumb */
.breadcrumb {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: var(--gap-m) var(--gap-l);
}

.breadcrumb-container {
    display: flex;
    align-items: center;
    gap: var(--gap-s);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: var(--gap-s);
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
}

.breadcrumb-item.active {
    color: var(--primary-blue);
}

.breadcrumb-item i {
    font-size: 16px;
}

/* Main Content */
.main-content {
    padding: 88px var(--gap-l) var(--gap-l) var(--gap-l);
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 64px - var(--footer-height));
    margin-top: 64px; /* Altura do header */
    padding-bottom: calc(var(--footer-height) + env(safe-area-inset-bottom) + var(--gap-m));
}

@media (max-width: 480px) {
    .main-content {
        margin-top: 32px;
    }
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--gap-l);
    padding: var(--gap-l) 0;
}

@media (max-width: 640px) {
    .toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--gap-m);
    }
    
    .toolbar-left {
        width: 100%;
        justify-content: center;
    }
    
    .toolbar-right {
        width: 100%;
        justify-content: center;
    }
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: var(--gap-m);
}

.view-options {
    display: flex;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    overflow: hidden;
}

@media (max-width: 480px) {
    /* Header logo spacing and icon alignment */
    .logo { gap: 8px; align-items: center; }
    .logo h1 { margin: 0; line-height: 1.2; }
    .logo-icon { display: inline-flex; align-items: center; vertical-align: middle; }
    
    /* Toolbar compact spacing (already set above, ensure override) */
    .toolbar { padding: var(--gap-s) 0; margin-bottom: var(--gap-m); flex-direction: row; align-items: center; justify-content: space-between; gap: var(--gap-s); }
    .toolbar-left, .toolbar-right { width: auto; }
    
    /* Search spacing tighter */
    .search-container { margin: 0 auto var(--gap-s) auto; }
    
    /* Modal layout safer for taps */
    .modal-header { padding: 12px 16px; flex-wrap: wrap; }
    .modal-title-area { flex: 0 0 100%; order: 1; padding-right: 0; }
    .modal-actions { width: 100%; order: 2; display: flex; flex-direction: column; gap: 8px; }
    .btn-download { width: 100%; }
    .close-btn { position: absolute; top: 10px; right: 10px; }
    .modal-content { width: 100%; max-width: 100%; height: 85vh; margin: 0; border-radius: 0; }
    .view-options { margin-top: 0; }
    /* Search spacing tighter */
    .search-container { margin: 0 auto var(--gap-s) auto; }
    /* Ensure icon aligns with text */
    .logo-icon { display: inline-flex; align-items: center; }
}

.view-btn {
    background: transparent;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--gray-600);
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: var(--gray-100);
}

.view-btn.active {
    background: var(--primary-blue);
    color: var(--white);
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: var(--gap-m);
    position: relative;
    z-index: 10;
}

.category-filter,
.sort-options {
    margin-left: 1rem;
}

.category-filter select,
.sort-options select {
    padding: 8px 12px;
    border: 1px solid var(--gray-400);
    border-radius: 6px;
    background: var(--gray-300);
    font-size: 14px;
    cursor: pointer;
    color: var(--gray-700);
    transition: border-color 0.2s ease;
}

.category-filter select:hover,
.sort-options select:hover {
    border-color: var(--primary-blue);
}

.category-filter select:focus,
.sort-options select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Files Container */
.files-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--gap-l);
    padding: var(--gap-l) 0;
    margin-bottom: calc(var(--footer-height) + var(--gap-xl) + env(safe-area-inset-bottom));
}

.files-container.list-view {
    display: flex;
    flex-direction: column;
    gap: var(--gap-s);
}

/* File Item */
.file-item {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: var(--gap-l);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(40px + var(--gap-s));
}

@media (max-width: 640px) {
    .file-item {
        padding: var(--gap-m);
        padding-bottom: calc(50px + var(--gap-s));
    }
}

.file-item:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.file-preview {
    position: relative;
    margin-bottom: var(--gap-m);
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.file-icon {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
}

.file-icon i {
    font-size: 24px;
    color: var(--primary-orange);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.file-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.file-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.file-info {
    margin-bottom: var(--gap-m);
}

.file-name {
    font-family: 'museo', serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--gray-800);
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.file-details {
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 300;
}

@media (max-width: 640px) {
    .file-details {
        font-size: 12px;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        margin-top: 4px;
    }
    
    .file-details span {
        display: inline-block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
}

.file-description {
    font-size: 13px;
    color: var(--ink-dim);
    margin-top: 6px;
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    margin: 8px 0 12px 0;
    font-family: Montserrat, sans-serif;
    font-style: italic;
    opacity: 0.9;
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 3px solid var(--a2);
    width: 100%;
}

/* Footer */
.footer {
    background: linear-gradient(to bottom, rgba(10,14,24,.95), rgba(10,14,24,1));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 60px;
    padding: 40px 0 20px 0;
    color: #e8ecf5;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(14px, 2.2vw, 40px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--gap-xl);
}

.footer-section h4 {
    color: #4de1c1;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: 0.02em;
}

.footer-section p {
    color: #c6cddd;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-decoration: none;
    color: #e8ecf5;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.social-link.linkedin:hover {
    background: rgba(0, 119, 181, 0.15);
    border-color: rgba(0, 119, 181, 0.3);
    color: #0077b5;
}

.social-link.instagram:hover {
    background: linear-gradient(45deg, rgba(225, 48, 108, 0.15), rgba(255, 220, 128, 0.15));
    border-color: rgba(225, 48, 108, 0.3);
    color: #e1306c;
}

.social-link.youtube:hover {
    background: rgba(255, 0, 0, 0.15);
    border-color: rgba(255, 0, 0, 0.3);
    color: #ff0000;
}

.social-link i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.footer-bottom {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.footer-bottom p {
    color: #c6cddd;
    font-size: 13px;
    margin: 0;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .social-links {
        align-items: center;
    }
    
    .social-link {
        max-width: 280px;
        width: 100%;
    }
}

.file-actions {
    display: flex;
    gap: 8px;
    transition: opacity 0.3s ease;
    opacity: 1;
    position: absolute;
    bottom: 10px;
    right: 10px;
}

@media (max-width: 640px) {
    .file-actions {
        bottom: var(--gap-s);
        right: var(--gap-s);
        gap: var(--gap-s);
        z-index: 5; /* Garantir que fique acima de outros elementos */
    }
    
    .file-actions button {
        width: 32px;
        height: 32px;
    }
}

.file-item:hover .file-actions {
    opacity: 1;
}

.action-btn {
    background: var(--gray-100);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-600);
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--primary-blue);
    color: var(--white);
    transform: scale(1.1);
}

/* List View Styles */
.files-container.list-view .file-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
}

.files-container.list-view .file-preview {
    width: 48px;
    height: 48px;
    margin-bottom: 0;
    margin-right: 16px;
    flex-shrink: 0;
}

.files-container.list-view .file-info {
    flex: 1;
    margin-bottom: 0;
}

.files-container.list-view .file-name {
    font-size: 14px;
    margin-bottom: 2px;
}

.files-container.list-view .file-details {
    font-size: 12px;
}

.files-container.list-view .file-actions {
    opacity: 1;
    margin-left: 16px;
}

/* Modal Styles - Baseado na página de referência */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 24, .7);
    backdrop-filter: saturate(115%) blur(12px);
    -webkit-backdrop-filter: saturate(115%) blur(12px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)), rgba(255,255,255,.02);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    margin: 2% auto;
    border-radius: var(--radius);
    width: 95%;
    max-width: 1200px;
    height: 95vh; /* Altura maior para ocupar mais da tela */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.modal-header {
    padding: clamp(15px, 3vw, 25px);
    border-bottom: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title-area {
    flex: 1;
    padding-right: 20px;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: var(--gap-m);
}

.btn-download {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-download:hover {
    background: var(--dark-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.modal-header h3 {
    font-family: 'museo', serif;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 8px 0;
    font-size: var(--fz-3);
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-subtitle {
    margin: 0;
    font-size: var(--fz-1);
    color: var(--ink-dim);
    font-family: Montserrat, sans-serif;
}

.close-btn {
    background: rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 18px;
    cursor: pointer;
    color: var(--gray-600);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: 5px;
}

.close-btn:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.modal-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100% - 70px); /* Altura total menos o header */
}

.modal-body iframe {
    border: none;
    width: 100%;
    height: 100%;
    flex: 1;
    object-fit: contain;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.file-item {
    animation: slideUp 0.3s ease;
}

/* Login Modal Styles */
.login-modal {
    max-width: 450px;
}

.login-modal .modal-header {
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
    padding: 0 clamp(20px, 4vw, 32px);
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--ink);
    font-size: var(--fz-1);
    letter-spacing: 0.02em;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--ink);
    font-size: var(--fz-1);
    font-family: Montserrat, sans-serif;
    transition: all var(--t-2);
    box-sizing: border-box;
}

.form-group input::placeholder {
    color: var(--ink-dim);
    opacity: 0.7;
}

.form-group input:focus {
    outline: none;
    border-color: var(--a1);
    background: rgba(255, 255, 255, 0.10);
    box-shadow: 0 0 0 3px rgba(77, 225, 193, 0.2);
    transform: translateY(-1px);
}

.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--ink);
    font-size: var(--fz-1);
    font-family: Montserrat, sans-serif;
    transition: all var(--t-2);
    box-sizing: border-box;
    resize: vertical;
    min-height: 80px;
}

.form-group textarea::placeholder {
    color: var(--ink-dim);
    opacity: 0.7;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--a1);
    background: rgba(255, 255, 255, 0.10);
    box-shadow: 0 0 0 3px rgba(77, 225, 193, 0.2);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 20px clamp(20px, 4vw, 32px);
    border-top: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.02);
}

.btn-primary, .btn-secondary, .btn-upload {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: var(--fz-1);
    cursor: pointer;
    transition: all var(--t-2);
    letter-spacing: 0.02em;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--g1);
    color: #0b1020;
    box-shadow: 0 4px 20px rgba(77,225,193,.30), inset 0 1px 0 rgba(255,255,255,.45);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(77,225,193,.40), inset 0 1px 0 rgba(255,255,255,.55);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--ink-dim);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.btn-upload {
    background: var(--g2);
    color: #0b1020;
    box-shadow: 0 4px 20px rgba(255,122,89,.30);
}

.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255,122,89,.40);
}

.login-error {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #ff6b6b;
    padding: 12px;
    border-radius: 12px;
    margin: 16px clamp(20px, 4vw, 32px);
    font-size: var(--fz-1);
    font-family: Montserrat, sans-serif;
}

.login-hint {
    padding: 16px clamp(20px, 4vw, 32px);
    background: rgba(77, 225, 193, 0.08);
    border-top: 1px solid rgba(77, 225, 193, 0.2);
    text-align: center;
}

.login-hint small {
    color: var(--ink-dim);
    font-family: Montserrat, sans-serif;
    font-size: 13px;
    line-height: 1.4;
}

/* Upload Modal Styles */
.upload-modal {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

#selectedFiles .file-item {
    padding: 12px;
}

#selectedFiles .file-description-container {
    margin-top: 8px;
    width: 100%;
}

#selectedFiles .file-custom-name,
#selectedFiles .file-description {
    width: 100%;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    font-size: var(--fz-1);
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--ink);
}

#selectedFiles .file-custom-name {
    margin-bottom: 8px;
}

#selectedFiles .file-description {
    resize: vertical;
    min-height: 60px;
}

.upload-section {
    padding: clamp(20px, 4vw, 32px);
}

.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    transition: all var(--t-2);
    cursor: pointer;
    margin: 20px 0;
}

.upload-area:hover {
    border-color: var(--a1);
    background: rgba(77, 225, 193, 0.05);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: var(--a1);
    background: rgba(77, 225, 193, 0.1);
    box-shadow: 0 0 20px rgba(77, 225, 193, 0.2);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.upload-area p {
    margin: 0 0 20px 0;
    color: var(--ink-dim);
    font-size: var(--fz-2);
    font-family: Montserrat, sans-serif;
}

/* Selected Files Display */
.selected-files {
    margin-top: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 300px;
    overflow-y: auto;
}

.selected-files h4 {
    margin: 0 0 12px 0;
    color: #e8ecf5;
    font-size: 14px;
    font-weight: 600;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selected-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.selected-file-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.selected-file-item .file-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.selected-file-item .file-name {
    font-weight: 500;
    color: #e8ecf5;
    font-size: 14px;
}

.selected-file-item .file-size {
    color: #c6cddd;
    font-size: 12px;
}

.remove-file-btn {
    background: rgba(255, 122, 89, 0.1);
    border: 1px solid rgba(255, 122, 89, 0.2);
    color: #ff7a59;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.remove-file-btn:hover {
    background: rgba(255, 122, 89, 0.2);
    border-color: rgba(255, 122, 89, 0.4);
    transform: scale(1.05);
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all var(--t-2);
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.10);
    transform: translateX(4px);
}

.file-item .file-icon {
    font-size: 20px;
    color: var(--a3);
}

.file-item .file-info {
    flex: 1;
}

.file-item .file-name {
    font-weight: 600;
    color: var(--ink);
    font-size: var(--fz-1);
    margin-bottom: 4px;
}

.file-item .file-size {
    font-size: 13px;
    color: var(--ink-dim);
    font-family: Montserrat, sans-serif;
}

.file-item .remove-btn {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #ff6b6b;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--t-2);
}

.file-item .remove-btn:hover {
    background: rgba(244, 67, 54, 0.2);
    transform: scale(1.05);
}

.upload-progress {
    padding: 0 clamp(20px, 4vw, 32px);
    margin: 20px 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: var(--fz-1);
    font-family: Montserrat, sans-serif;
}

.progress-header #uploadStatus {
    color: var(--ink);
    font-weight: 600;
}

.progress-header #uploadPercentage {
    color: var(--a1);
    font-weight: 700;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--g1);
    width: 0%;
    transition: width var(--t-2) ease;
    border-radius: 6px;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.upload-results {
    padding: 0 clamp(20px, 4vw, 32px);
    max-height: 300px;
    overflow-y: auto;
}

.upload-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    margin-bottom: 8px;
    font-size: var(--fz-1);
    font-family: Montserrat, sans-serif;
    border-left: 4px solid transparent;
    transition: all var(--t-2);
}

.upload-result.success {
    border-left-color: var(--a1);
    background: rgba(77, 225, 193, 0.08);
}

.upload-result.error {
    border-left-color: #ff6b6b;
    background: rgba(244, 67, 54, 0.08);
}

.upload-result .icon {
    font-size: 18px;
}

.upload-result.success .icon {
    color: var(--a1);
}

.upload-result.error .icon {
    color: #ff6b6b;
}

.upload-result .result-info {
    flex: 1;
}

.upload-result .result-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.upload-result .result-details {
    font-size: 13px;
    opacity: 0.8;
}

/* PDF Thumbnail Generation */
.thumbnail-generating {
    position: relative;
    overflow: hidden;
}

.thumbnail-generating::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 12px 10px 5px 22px;
        flex-direction: column;
        gap: 0px;
    }
    
    .header-center {
        margin: 0;
        max-width: none;
        width: 100%;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .files-container {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: var(--gap-m);
    }
    
    .toolbar {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .toolbar-left,
    .toolbar-right {
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        height: 95%;
        margin: 2.5% auto;
    }
    
    .login-modal,
    .upload-modal {
        width: calc(100% - 40px);
        max-width: none;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .files-container {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--gap-s);
        padding-bottom: 60px; /* Margem após o último card */
    }
    
    .file-item {
        padding: var(--gap-s);
        padding-bottom: calc(50px + var(--gap-s)); /* Espaço para os botões de ação */
    }
    
    /* Aplicar margin-bottom apenas na última linha de cards */
    .files-container {
        margin-bottom: calc(var(--footer-height) + var(--gap-l) + env(safe-area-inset-bottom)); /* Margem para evitar que a última linha fique escondida pelo rodapé */
    }
    
    .file-item .file-name {
        font-size: 11px;
        -webkit-line-clamp: 2;
        max-height: 36px;
        overflow: hidden;
    }
    
    .file-item .file-details {
        font-size: 12px;
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
        line-height: 1.3;
    }
    
    .file-item .file-icon {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        color: white;
    }
    
    /* Ajustes para thumbnails de categoria como imagem */
    .category-card-icon img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 8px;
        display: block;
    }
    
    .file-info {
        margin-bottom: 8px;
    }
    
    /* Ajustes do modal para mobile */
    .modal-content {
        width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .close-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.3);
        color: white;
        z-index: 1010;
        width: 36px;
        height: 36px;
    }
    
    #pdfViewer {
        height: calc(100vh - 70px);
    }
    
    .file-actions {
        gap: var(--gap-s);
    }
    
    .action-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .logo h1 {
        font-size: 18px;
        margin: 0 0 0 0;
    }
    
    .file-preview {
        height: 120px;
    }
}

/* Loading States */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--gray-500);
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-top: 2px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 12px;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 48px;
    color: var(--gray-400);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-family: 'museo', serif;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--gray-600);
}

.empty-state p {
    font-size: 14px;
    line-height: 1.5;
}

/* Notificações */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--gray-300);
    color: var(--gray-700);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-hover);
    z-index: 1001;
    border: 1px solid var(--gray-400);
    transition: all 0.3s ease;
}

.toast.success {
    background: var(--success-color);
    color: white;
}

.toast.error {
    background: var(--error-color);
    color: white;
}

.toast.warning {
    background: var(--warning-color);
    color: var(--gray-100);
}
/* Subtítulo de seção (abaixo do título) */
.section-subtitle {
    font-size: 0.95rem;
    color: var(--ink-2);
    margin-top: -0.5rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 768px) {
    .category-cards-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .category-card {
        padding: 1rem;
    }
    
    .category-card-title {
        font-size: 1.1rem;
    }
    
    .category-card-count {
        font-size: 1.5rem;
    }
}

/* Link "Todas as categorias" abaixo dos cards */
.category-cards-all {
    margin-top: 0.5rem;
}
.category-cards-all .all-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--a1);
    background: transparent;
    border: none;
    padding: 6px 0;
    cursor: pointer;
}
.category-cards-all .all-link i { font-size: 0.95rem; }
.category-cards-all .all-link:hover { text-decoration: underline; }

/* Legacy Footer - match initial version */
.appfoot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--footer-height);
  background: linear-gradient(to bottom, rgba(10,14,24,.85), rgba(10,14,24,.25));
  backdrop-filter: saturate(115%) blur(12px);
  -webkit-backdrop-filter: saturate(115%) blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 50;
}

.appfoot .social {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 24px);
  color: #c6cddd;
  font-size: 14px;
  padding: 0 clamp(14px, 2.2vw, 40px);
}

.appfoot .social .site {
  color: #e8ecf5;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.appfoot .social a {
  text-decoration: none;
}

.appfoot .social .ico {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: inline-grid;
  place-items: center;
  color: #e8ecf5;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.25s ease;
}

/* Font Awesome brand icons via pseudo-element */
.appfoot .social .ico::before {
  font-family: "Font Awesome 6 Brands";
  font-weight: 400;
  font-size: 16px;
  line-height: 1;
  display: inline-block;
}

.appfoot .social .ico.insta::before { content: "\f16d"; }
.appfoot .social .ico.linked::before { content: "\f08c"; }
.appfoot .social .ico.yt::before    { content: "\f167"; }

/* Hovers com cores de marca */
.appfoot .social .ico.insta:hover {
  color: #e1306c;
  border-color: rgba(225, 48, 108, 0.4);
  background: rgba(225, 48, 108, 0.1);
}

.appfoot .social .ico.linked:hover {
  color: #0077b5;
  border-color: rgba(0, 119, 181, 0.4);
  background: rgba(0, 119, 181, 0.1);
}

.appfoot .social .ico.yt:hover {
  color: #ff0000;
  border-color: rgba(255, 0, 0, 0.4);
  background: rgba(255, 0, 0, 0.1);
}

@media (max-width: 640px) {
  .appfoot .social {
    gap: 12px;
    font-size: 13px;
  }
  .appfoot .social .ico {
    width: 32px;
    height: 32px;
  }
}

/* Category Cards - base styles */
.category-cards-section { padding-top: 8px; }

.category-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--gap-l);
  margin-top: 8px;
}

.category-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: clamp(14px, 2.5vw, 18px);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.category-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-card-title {
  margin: 0;
  font-weight: 700;
  color: #e8ecf5;
  font-size: 1.125rem;
}

.category-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(61, 139, 255, 0.25), rgba(77, 225, 193, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e8ecf5;
  flex-shrink: 0;
}

.category-card-stats {
  margin-left: auto;
  text-align: right;
}

.category-card-count {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  color: #e8ecf5;
  margin: 0;
}

.category-card-label {
  margin: 2px 0 0 0;
  font-size: 0.85rem;
  color: #c6cddd;
}

.category-card-updated {
  margin: 4px 0 0 0;
  font-size: 0.8rem;
  color: #9fb0ca;
  opacity: 0.9;
}