/* Design System - Cloud Upload (Modern Purple/Indigo Theme) */
:root {
    --bg-main: radial-gradient(circle at top right, #1e1b4b, #0f172a);
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-darker: rgba(15, 23, 42, 0.6);
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-primary-glow: rgba(99, 102, 241, 0.25);
    --color-text-white: #ffffff;
    --color-text-light: #f1f5f9;
    --color-text-muted: #94a3b8;
    --color-text-success: #86efac;
    --color-text-danger: #fca5a5;
    --border-card: 1px solid rgba(99, 102, 241, 0.2);
    --border-soft: 1px solid rgba(148, 163, 184, 0.1);
    --shadow-main: 0 20px 40px rgba(0, 0, 0, 0.4);
    --font-family: 'Inter', sans-serif;
}

/* Reset básico */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background: var(--bg-main) !important;
    background-color: #0f172a !important; /* Fallback */
    color: var(--color-text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar Moderna e Responsiva */
.navbar {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: var(--border-soft);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.brand img.logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 8px;
}

.brand-title {
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #a5b4fc, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-greeting {
    font-size: 14px;
    color: var(--color-text-muted);
}

.user-greeting strong {
    color: var(--color-text-white);
}

/* Botões do Menu */
.nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-light);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-btn.btn-highlight {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    box-shadow: 0 4px 12px var(--color-primary-glow);
    border: none;
}

.nav-btn.btn-highlight:hover {
    background: linear-gradient(135deg, var(--color-primary-hover), #4338ca);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.nav-btn.logout-btn {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-text-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.nav-btn.logout-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fff;
}

.admin-badge {
    border: 1px solid rgba(236, 72, 153, 0.3);
    color: #f472b6 !important;
}

.admin-badge:hover {
    background: rgba(236, 72, 153, 0.15);
}

/* Layout Principal do Uploader (index.php) */
.main-container {
    flex: 1;
    width: 100%;
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.intro-section {
    text-align: center;
    margin-bottom: 35px;
}

.intro-section h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.intro-section p {
    font-size: 16px;
    color: var(--color-text-muted);
}

/* Grid de Dashboard Moderno (dashboard.php / admin.php) */
.dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    align-items: start;
}

/* Sidebar Dashboard */
.sidebar-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: var(--border-card);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow-main);
}

.sidebar-profile {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: var(--border-soft);
    margin-bottom: 20px;
}

.avatar-circle {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #6366f1, #c7d2fe);
    color: #0f172a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    margin: 0 auto 15px auto;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.sidebar-profile h3 {
    font-size: 18px;
    color: #fff;
    font-weight: 700;
    margin-bottom: 4px;
}

.sidebar-profile p {
    font-size: 12px;
    color: var(--color-text-muted);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-menu-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted);
    background: none;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-menu-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-menu-btn.active {
    color: #fff;
    background: var(--color-primary);
    box-shadow: 0 4px 12px var(--color-primary-glow);
    border-color: rgba(99, 102, 241, 0.2);
}

.sidebar-menu-btn.logout-btn-sidebar {
    margin-top: 15px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--color-text-danger);
}

.sidebar-menu-btn.logout-btn-sidebar:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fff;
}

/* Painel de Conteúdo Principal */
.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Grid de Cards Estatísticos */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: var(--border-soft);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    font-size: 28px;
    background: rgba(99, 102, 241, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a5b4fc;
}

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

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

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

/* Tabelas e Cards de Informação */
.panel-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: var(--border-card);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow-main);
    overflow: hidden;
}

.panel-card h3 {
    font-size: 18px;
    color: #fff;
    margin-bottom: 20px;
    border-left: 4px solid #6366f1;
    padding-left: 10px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

th, td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    vertical-align: middle;
}

th {
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

td {
    color: #cbd5e1;
}

.file-name-cell {
    font-weight: 600;
    color: #fff;
    word-break: break-all;
}

.expires-cell {
    color: var(--color-text-danger);
}

/* Badges e Status */
.role-badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
}

.role-admin {
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.role-user {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Botões do Painel */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-link-copy {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
    margin-right: 8px;
}

.btn-link-copy:hover {
    background: rgba(99, 102, 241, 0.3);
    color: #fff;
}

.btn-delete {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fff;
}

/* Upload Card (Uploader Inicial) */
.upload-card {
    width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--border-card);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow-main);
    margin-bottom: 35px;
}

.upload-badge {
    background: var(--bg-darker);
    border: var(--border-soft);
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 13px;
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: 25px;
}

.upload-badge strong {
    color: #a5b4fc;
}

.drop-zone {
    border: 2px dashed rgba(99, 102, 241, 0.4);
    background: var(--bg-darker);
    border-radius: 12px;
    padding: 50px 30px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.drop-zone.dragover {
    border-color: var(--color-primary);
    background: rgba(99, 102, 241, 0.08);
    transform: scale(1.01);
    box-shadow: 0 0 20px var(--color-primary-glow);
}

.icon-cloud {
    font-size: 48px;
    margin-bottom: 15px;
}

.drop-zone h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-white);
    margin-bottom: 8px;
}

.drop-zone p {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 20px;
}

/* Uploader Progress */
.progress-wrapper {
    display: none;
    margin-top: 25px;
    background: var(--bg-darker);
    border: var(--border-soft);
    border-radius: 12px;
    padding: 20px;
}

.file-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--color-primary), #818cf8);
    border-radius: 4px;
    transition: width 0.2s ease;
}

.upload-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Success Box e Copiador de links */
.success-box {
    margin-top: 10px;
    border: 1px solid rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.1);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
}

.success-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.success-box h4 {
    font-size: 16px;
    color: var(--color-text-success);
    margin-bottom: 8px;
}

.success-desc {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 20px;
}

.link-copier {
    display: flex;
    gap: 10px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    padding: 6px;
    border: var(--border-soft);
}

.link-copier input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 13px;
    padding: 8px;
}

.btn-copy {
    padding: 8px 16px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: var(--color-primary-hover);
}

.btn-copy.copied {
    background: #22c55e;
}

/* Formulários Administrativos e Cadastro */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.form-group input, .form-group select {
    padding: 12px;
    font-size: 14px;
    background: rgba(15, 23, 42, 0.5);
    border: 1.5px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    color: #fff;
    outline: none;
    transition: all 0.3s;
}

.form-group input:focus, .form-group select:focus {
    border-color: #6366f1;
    background: rgba(15, 23, 42, 0.7);
}

.btn-submit-form {
    padding: 12px 24px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-submit-form:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
}

/* Formatos de Arquivo */
.formats-section {
    text-align: center;
    width: 100%;
}

.formats-section h4 {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 15px;
    font-weight: 600;
}

.formats-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.format-tag {
    background: rgba(255, 255, 255, 0.05);
    border: var(--border-soft);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
}

/* Rodapé */
.footer {
    text-align: center;
    padding: 30px 20px;
    border-top: var(--border-soft);
    font-size: 13px;
    color: var(--color-text-muted);
    background: rgba(15, 23, 42, 0.4);
    margin-top: auto;
}

.no-data {
    text-align: center;
    padding: 40px 0;
    color: var(--color-text-muted);
}

.no-data-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

/* Responsividade Geral */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .navbar-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .main-container {
        margin: 20px auto;
    }
    
    .intro-section h1 {
        font-size: 28px;
    }
    
    .upload-card {
        padding: 20px;
    }
    
    .drop-zone {
        padding: 30px 15px;
}

/* Modais do Sistema (Editar Usuário) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.modal-card {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 16px;
    padding: 30px;
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-main);
    color: #fff;
    position: relative;
    animation: scaleUp 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: var(--border-soft);
    padding-bottom: 15px;
}

.modal-header h3 {
    font-size: 18px;
    color: #fff;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-close-modal:hover {
    color: #fff;
}

/* Abas do Dashboard */
.tab-content {
    display: none !important;
}

.tab-content.active {
    display: block !important;
    animation: fadeIn 0.4s ease-out;
}
