/**
 * FileVault - Estilos
 */

/* === VARIÁVEIS === */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --bg-input: #0f172a;
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border: #334155;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* === RESET === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1a2e 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* === LOGIN PAGE === */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow), 0 0 60px rgba(99, 102, 241, 0.1);
    border: 1px solid var(--border);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    font-size: 4rem;
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
}

/* === FORMS === */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

input[type="text"],
input[type="password"],
input[type="email"],
select {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

input::placeholder {
    color: var(--text-muted);
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--secondary);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* === HEADER === */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-small {
    font-size: 2rem;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    color: var(--text-secondary);
}

.space-info {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-admin {
    background: var(--primary);
    color: white;
}

/* === TOOLBAR === */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(30, 41, 59, 0.5);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.breadcrumb {
    display: flex;
    gap: 8px;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--primary-light);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: var(--text-muted);
}

/* === FILE LIST === */
.main-content {
    padding: 24px;
}

.file-list-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.file-list {
    width: 100%;
    border-collapse: collapse;
}

.file-list th,
.file-list td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.file-list th {
    background: rgba(0, 0, 0, 0.2);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.file-list tr:hover td {
    background: var(--bg-hover);
}

.file-list tr:last-child td {
    border-bottom: none;
}

.col-icon {
    width: 50px;
    text-align: center;
    font-size: 1.5rem;
}

.col-name {
    min-width: 200px;
}

.col-size,
.col-date {
    width: 150px;
    color: var(--text-secondary);
}

.col-actions {
    width: 180px;
}

.file-name {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-primary);
}

.file-name:hover {
    color: var(--primary-light);
}

.action-btn {
    padding: 6px 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    margin-right: 4px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.action-btn.delete:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.loading {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 20px !important;
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* === MODALS === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    animation: modalIn 0.3s ease;
}

.modal-sm {
    max-width: 400px;
}

.modal-lg {
    max-width: 800px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* === UPLOAD === */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.progress-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    width: 0%;
    transition: width 0.3s ease;
}

/* === USERS LIST === */
.user-form {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 8px;
}

.form-row input,
.form-row select {
    flex: 1;
}

.form-row .btn {
    flex-shrink: 0;
}

.users-list {
    max-height: 300px;
    overflow-y: auto;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.user-item:last-child {
    border-bottom: none;
}

/* === LOGS === */
.logs-list {
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
}

.log-entry {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 150px 100px 100px 1fr;
    gap: 12px;
}

.log-entry:nth-child(even) {
    background: rgba(0, 0, 0, 0.1);
}

.log-time {
    color: var(--text-muted);
}

.log-user {
    color: var(--primary-light);
}

.log-action {
    color: var(--success);
}

.log-details {
    color: var(--text-secondary);
}

/* === ALERTS === */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--danger);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid var(--success);
    color: #86efac;
}

/* === UTILITIES === */
.text-muted {
    color: var(--text-muted);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 12px;
    }
    
    .toolbar {
        flex-direction: column;
    }
    
    .file-list th:nth-child(3),
    .file-list td:nth-child(3),
    .file-list th:nth-child(4),
    .file-list td:nth-child(4) {
        display: none;
    }
    
    .log-entry {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .form-row {
        flex-wrap: wrap;
    }
}
