/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
}

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

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

button {
    width: 100%;
    padding: 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
}

button:hover {
    background: #5a6fd8;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.mensaje {
    background: #d1edff;
    color: #0c5460;
    padding: 0.75rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

/* Dashboard */
.admin-header {
    background: #333;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.admin-header nav {
    display: flex;
    gap: 1rem;
}

.admin-main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.btn {
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.btn:hover {
    background: #5a6fd8;
}

.btn-logout {
    background: #dc3545;
}

.btn-edit {
    background: #28a745;
}

.btn-delete {
    background: #dc3545;
}

/* Grid de trabajos */
.trabajos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.trabajo-card {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 1rem;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.trabajo-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.trabajo-card h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.trabajo-card p {
    color: #666;
    margin-bottom: 1rem;
}

.acciones {
    display: flex;
    gap: 0.5rem;
}

/* Formularios */
.form-trabajo {
    max-width: 600px;
    margin: 0 auto;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .admin-header nav {
        width: 100%;
        justify-content: center;
    }
    
    .trabajos-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-main {
        padding: 1rem;
    }
    
    .acciones {
        flex-direction: column;
    }
}

/* Estilos adicionales para las nuevas funcionalidades */

.imagen-actual {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
}

.image-preview {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    margin-top: 0.5rem;
    text-align: center;
    border: 1px dashed #dee2e6;
}

.image-preview img {
    border-radius: 5px;
}

/* Filtros y búsqueda */
.filtros {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.filtros input,
.filtros select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Estados de los trabajos */
.trabajo-inactivo {
    opacity: 0.6;
    background: #f8f9fa;
}

.trabajo-inactivo::after {
    content: " (Inactivo)";
    color: #dc3545;
    font-weight: bold;
}

/* Mejoras responsive */
@media (max-width: 480px) {
    .filtros {
        flex-direction: column;
        align-items: stretch;
    }
    
    .admin-header h1 {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .acciones .btn {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Animaciones */
.trabajo-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.trabajo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Estados de carga */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin: 20px auto;
}

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

