* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f4f4f4;
    color: #333;
}

/* Navbar */
.navbar {
    background: #2c3e50;
    color: white;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-brand {
    font-size: 20px;
    font-weight: bold;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 15px;
}

.btn-logout {
    background: #e74c3c;
    padding: 6px 14px;
    border-radius: 6px;
}

.btn-logout:hover {
    background: #c0392b;
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #f4f4f4;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    margin-bottom: 24px;
    text-align: center;
    color: #2c3e50;
    font-size: clamp(20px, 5vw, 28px);
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

.login-box button:hover {
    background: #1a252f;
}

/* Mensajes */
.error {
    background: #fdecea;
    color: #e74c3c;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 16px;
    text-align: center;
}

.success {
    background: #eafaf1;
    color: #27ae60;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 16px;
    text-align: center;
}

/* Contenedor principal */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 16px;
}

/* Upload */
.upload-box {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.upload-box h2 {
    margin-bottom: 16px;
    color: #2c3e50;
    font-size: clamp(16px, 4vw, 22px);
}

.upload-box form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.upload-box input[type="file"] {
    flex: 1;
    min-width: 200px;
}

.upload-box button {
    padding: 10px 24px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    white-space: nowrap;
}

.upload-box button:hover {
    background: #1a252f;
}

/* Filtros */
.filtros {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filtros a {
    padding: 8px 20px;
    background: white;
    border-radius: 20px;
    text-decoration: none;
    color: #555;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: all 0.2s;
    font-size: 14px;
}

.filtros a:hover,
.filtros a.activo {
    background: #2c3e50;
    color: white;
}

/* Galeria grid */
.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-4px);
}

.card img {
    width: 100%;
    height: auto;
    display: block;
}

.card video {
    width: 100%;
    height: auto;
    display: block;
}

.card-info {
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-info span {
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}

.btn-eliminar {
    color: #e74c3c;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
}

.btn-eliminar:hover {
    color: #c0392b;
}

/* Paginacion */
.paginacion {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.paginacion a {
    padding: 10px 24px;
    background: #2c3e50;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 15px;
}

.paginacion a:hover {
    background: #1a252f;
}

.paginacion span {
    color: #555;
    font-size: 15px;
}

/* Responsive tablet */
@media (max-width: 768px) {
    .galeria-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .navbar {
        padding: 12px 16px;
    }
}

/* Responsive movil */
@media (max-width: 480px) {
    .galeria-grid {
        grid-template-columns: 1fr;
    }

    .login-box {
        padding: 24px 16px;
    }

    .filtros a {
        padding: 6px 14px;
        font-size: 13px;
    }

    .nav-brand {
        font-size: 17px;
    }
}

.card-no-compatible {
    background: #f0f0f0;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 13px;
}

.contadores {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #555;
}

.contadores span strong {
    color: #2c3e50;
    font-size: 16px;
}