/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #dc143c 0%, #8b0000 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #dc143c 0%, #8b0000 100%);
    color: white;
    padding: 30px;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.header-text {
    flex: 1;
}

.header-logo {
    flex-shrink: 0;
}

.header-logo img {
    max-width: 150px;
    height: auto;
    display: block;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

header h2 {
    font-size: 1.3rem;
    font-weight: normal;
    opacity: 0.95;
    color: #f5f5f5;
}

header .evento-descripcion {
    color: #f5f5f5;
    opacity: 0.95;
    line-height: 1.5;
}

header nav {
    margin-top: 20px;
}

/* Main */
main {
    padding: 30px;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #dc143c;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn:hover {
    background: #b01030;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 20, 60, 0.3);
}

.btn-primary {
    background: #8b0000;
}

.btn-primary:hover {
    background: #660000;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-info {
    background: #17a2b8;
}

.btn-info:hover {
    background: #138496;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-large {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
}

/* Formularios */
.form {
    max-width: 800px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #dc143c;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.required {
    color: #dc3545;
    font-weight: bold;
}

.required-note {
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Alertas */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Tablas */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    min-width: 600px;
}

.table thead {
    background: #f8f9fa;
}

.table th,
.table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

.table th {
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table .actions {
    white-space: nowrap;
}

/* Estilos para botones extra pequeños */
.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 3px;
    white-space: nowrap;
}

/* Grupo de botones verticales para acciones */
.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.btn-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* Celda de acciones */
.actions-cell {
    min-width: 200px;
}

/* Ocultar/mostrar elementos según dispositivo */
.hide-mobile {
    display: table-cell;
}

.show-mobile {
    display: none;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* Grid de eventos */
.eventos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.evento-card {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.evento-card:hover {
    border-color: #dc143c;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.evento-card h3 {
    color: #dc143c;
    margin-bottom: 10px;
}

.evento-descripcion {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.evento-fechas {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Dos columnas */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.column {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
}

.column h3 {
    margin-bottom: 20px;
    color: #dc143c;
}

/* Lista de campos */
.campos-list {
    margin-top: 15px;
}

.campo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    margin-bottom: 10px;
    cursor: move;
    transition: all 0.3s ease;
}

.campo-item:hover {
    background: #e9ecef;
    border-color: #dc143c;
}

.campo-item.dragging {
    opacity: 0.5;
}

.campo-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.drag-handle {
    cursor: move;
    color: #999;
    font-size: 16px;
}

.help-text {
    margin-top: 15px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Estadísticas */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #dc143c 0%, #8b0000 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-card h3 {
    font-size: 14px;
    font-weight: normal;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
}

/* Página de éxito */
.text-center {
    text-align: center;
}

.success-message {
    max-width: 600px;
    margin: 50px auto;
    padding: 40px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 30px;
}

.success-message h1 {
    color: #28a745;
    margin-bottom: 20px;
}

.success-message h2 {
    color: #dc143c;
    margin: 20px 0;
}

/* Footer */
footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 0;
    }
    
    /* Header responsive */
    header {
        padding: 20px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: center;
    }
    
    .header-logo {
        order: -1;
        margin-bottom: 15px;
    }
    
    .header-logo img {
        max-width: 120px;
    }
    
    .header-text {
        width: 100%;
        text-align: center;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    header nav {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    header nav .btn {
        width: 100%;
        margin: 0;
        text-align: center;
    }
    
    /* Main content */
    main {
        padding: 15px;
    }
    
    /* Tablas responsive */
    .table {
        font-size: 12px;
        min-width: 100%;
        display: block;
    }
    
    .table thead {
        display: block;
    }
    
    .table tbody {
        display: block;
    }
    
    .table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 5px;
        background: white;
    }
    
    .table th,
    .table td {
        display: block;
        text-align: left;
        padding: 8px 10px;
        border: none;
    }
    
    .table thead tr {
        display: none;
    }
    
    .table td[data-label]:before {
        content: attr(data-label) ": ";
        font-weight: bold;
        color: #555;
    }
    
    .table td.actions-cell {
        border-top: 1px solid #e0e0e0;
        background: #f8f9fa;
    }
    
    /* Ocultar elementos en móvil */
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: inline-block !important;
    }
    
    /* Ajustar botones en móvil */
    .btn-group-vertical {
        width: 100%;
    }
    
    .btn-row {
        width: 100%;
        justify-content: space-between;
    }
    
    .btn-row .btn {
        flex: 1;
    }
    
    .actions-cell {
        min-width: auto;
    }
    
    /* Formularios responsive */
    .two-columns {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        margin: 0;
    }
    
    /* Grid de eventos */
    .eventos-grid {
        grid-template-columns: 1fr;
    }
    
    /* Stats cards */
    .stats {
        grid-template-columns: 1fr;
    }
}

/* Tablets y pantallas medianas */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
        margin: 10px;
    }
    
    main {
        padding: 20px;
    }
    
    .table th,
    .table td {
        padding: 10px 6px;
        font-size: 13px;
    }
    
    .btn-xs {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .eventos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
