/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

/* Contenedor principal */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #bfa0df 100%);
    color: white;
    padding: 40px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.header-logo {
    flex-shrink: 0;
}

.logo-image {
    max-width: 150px;
    max-height: 150px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.header-text {
    flex: 1;
    text-align: left;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

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

    .logo-image {
        max-width: 120px;
        max-height: 120px;
    }

    header h1 {
        font-size: 2em;
    }

    header p {
        font-size: 1em;
    }
}

/* Alertas */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* Formularios */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.form-container h2 {
    margin-bottom: 20px;
    color: #333;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
input#accept_privacy, input#accept_usage {
    width: auto;
    float: left;
    margin-right: 5px;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-block {
    width: 100%;
}

/* Descarga */
.download-error,
.download-success {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-bottom: 30px;
}

.error-icon,
.success-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.download-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin: 20px 0;
    text-align: left;
}

.download-details h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.download-details p {
    margin-bottom: 10px;
}

.download-actions {
    margin: 30px 0;
}

.download-info {
    margin-top: 20px;
    color: #666;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #666;
    margin-top: 40px;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-box h1 {
    color: #333;
    margin-bottom: 10px;
}

.login-box p {
    color: #666;
    margin-bottom: 30px;
}

.login-form {
    margin-top: 20px;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
}

/* Admin Panel */
.admin-page {
    background: #f5f5f5;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 30px 20px;
    background: #1a252f;
}

.sidebar-header h2 {
    margin-bottom: 10px;
}

.sidebar-header p {
    font-size: 14px;
    opacity: 0.8;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav a {
    display: block;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: #34495e;
}

.admin-main {
    margin-left: 250px;
    flex: 1;
    padding: 40px;
}

.admin-header {
    margin-bottom: 30px;
}

.admin-header h1 {
    font-size: 2em;
    color: #fff;
    margin-bottom: 10px;
}

.admin-header p {
    color: #fff;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 48px;
}

.stat-content h3 {
    color: #666;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

/* Admin Section */
.admin-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.admin-section h2 {
    margin-bottom: 20px;
    color: #333;
}

/* Tabla */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.admin-table thead {
    background: #f8f9fa;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.admin-table th {
    font-weight: 600;
    color: #555;
}

.admin-table tbody tr:hover {
    background: #f8f9fa;
}

.admin-table .inactive-row {
    opacity: 0.6;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-expired {
    background: #f8d7da;
    color: #721c24;
}

.status-inactive {
    background: #e2e3e5;
    color: #383d41;
}

/* Upload Section */
.upload-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.upload-area h3 {
    margin-bottom: 10px;
    color: #333;
}

.upload-info {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

#fileInfo {
    text-align: center;
    padding: 20px;
}

#fileInfo h3 {
    margin-bottom: 15px;
}

#fileInfo p {
    margin-bottom: 20px;
    font-size: 18px;
}

/* Filters Form */
.filters-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

/* No Data */
.no-data {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-data a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.no-data a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 200px;
    }

    .admin-main {
        margin-left: 200px;
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-table {
        font-size: 14px;
    }

    .admin-table th,
    .admin-table td {
        padding: 8px;
    }
}

@media (max-width: 576px) {
    .admin-container {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }

    .admin-main {
        margin-left: 0;
    }

    header h1 {
        font-size: 1.8em;
    }

    .form-container {
        padding: 20px;
    }
}

/* Files List */
.files-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: all 0.3s;
}

.file-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.file-info h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1.1em;
}

.file-size {
    color: #666;
    font-size: 0.9em;
}

/* File Details Header */
.file-details-header {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.file-details-header h2 {
    margin-bottom: 15px;
    color: #667eea;
}

.file-meta {
    display: grid;
    gap: 10px;
}

.file-meta p {
    margin: 0;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.file-meta p:last-child {
    border-bottom: none;
}

/* Checkbox Group */
.checkbox-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin: 10px 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label span {
    flex: 1;
}

.checkbox-label strong {
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.checkbox-label small {
    display: block;
    line-height: 1.5;
}


.checkbox-label input[type="checkbox"]:checked + span strong {
    color: #007bff;
}
