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

:root {
    --primary-color: #ac252a;
    --gold-color: #9f7c35;
    --white-color: #fff;
    --primary-gradient: linear-gradient(135deg, #ac252a 0%, #8b1f23 100%);
    --gold-gradient: linear-gradient(135deg, #9f7c35 0%, #b8944f 50%, #9f7c35 100%);
    --gold-gradient-light: linear-gradient(135deg, #b8944f 0%, #d4b878 100%);
    --primary-gold-gradient: linear-gradient(135deg, #ac252a 0%, #9f7c35 100%);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #ac252a 0%, #8b1f23 50%, #9f7c35 100%);
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Contenedor de burbujas animadas */
.bubbles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.bubble {
    position: absolute;
    bottom: -100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    animation: float linear infinite;
    box-shadow: 0 20px 50px rgba(255, 255, 255, 0.1);
}

.bubble::before {
    content: '';
    position: absolute;
    width: 50%;
    height: 50%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    top: 20%;
    left: 20%;
}

.bubble-1 {
    width: 80px;
    height: 80px;
    left: 10%;
    animation-duration: 8s;
    animation-delay: 0s;
}

.bubble-2 {
    width: 60px;
    height: 60px;
    left: 20%;
    animation-duration: 10s;
    animation-delay: 2s;
}

.bubble-3 {
    width: 100px;
    height: 100px;
    left: 35%;
    animation-duration: 12s;
    animation-delay: 1s;
}

.bubble-4 {
    width: 70px;
    height: 70px;
    left: 50%;
    animation-duration: 9s;
    animation-delay: 3s;
}

.bubble-5 {
    width: 90px;
    height: 90px;
    left: 65%;
    animation-duration: 11s;
    animation-delay: 0.5s;
}

.bubble-6 {
    width: 55px;
    height: 55px;
    left: 75%;
    animation-duration: 13s;
    animation-delay: 2.5s;
}

.bubble-7 {
    width: 85px;
    height: 85px;
    left: 85%;
    animation-duration: 10s;
    animation-delay: 1.5s;
}

.bubble-8 {
    width: 65px;
    height: 65px;
    left: 5%;
    animation-duration: 14s;
    animation-delay: 4s;
}

.bubble-9 {
    width: 75px;
    height: 75px;
    left: 40%;
    animation-duration: 9s;
    animation-delay: 3.5s;
}

.bubble-10 {
    width: 95px;
    height: 95px;
    left: 90%;
    animation-duration: 15s;
    animation-delay: 2s;
}

@keyframes float {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px) rotate(360deg);
        opacity: 0;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
    width: 100%;
}

/* Header mejorado */
header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

header .container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.header-logo-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-img {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 2px 10px rgba(255, 255, 255, 0.3));
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.1) rotate(5deg);
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--white-color);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin: 0;
}

nav {
    display: flex;
    gap: 1rem;
}

/* Botones mejorados */
.btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-primary {
    background: var(--gold-gradient);
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    color: var(--white-color);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--gold-gradient-light);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(159, 124, 53, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ac252a 0%, #8b1f23 100%);
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #8b1f23 0%, #6d191c 100%);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    margin: 0 0.2rem;
}

/* Main */
main {
    padding: 3rem 0;
    min-height: calc(100vh - 200px);
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Catálogo Grid mejorado - Tarjetas Circulares */
.catalogo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
    padding: 2rem 0;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.proyecto-card {
    background: transparent;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    animation: fadeInUp 0.6s ease-out both;
    position: relative;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    aspect-ratio: 1;
    perspective: 1000px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Anillo animado alrededor de la tarjeta */
.proyecto-card::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 30px;
    background: var(--gold-gradient);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.5s ease;
    filter: blur(10px);
}

.proyecto-card:hover::before {
    opacity: 0.8;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Efecto de brillo */
.proyecto-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    pointer-events: none;
}

.proyecto-card:hover::after {
    width: 300px;
    height: 300px;
}

.proyecto-card:hover {
    transform: translateY(-15px) scale(1.05) rotate(2deg);
    box-shadow: 0 25px 70px rgba(159, 124, 53, 0.5);
}

.proyecto-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.proyecto-card:hover a {
    transform: rotateY(180deg);
}

.proyecto-imagen {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 30px;
    overflow: hidden;
    background: var(--primary-gradient);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: rotateY(0deg);
}

.proyecto-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.proyecto-card:hover .proyecto-imagen img {
    transform: scale(1.1);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(172, 37, 42, 0.98) 0%, rgba(139, 31, 35, 0.98) 100%);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 30px;
    transform: rotateY(180deg);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.nombre-proyecto-overlay {
    color: var(--white-color);
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    padding: 2rem;
    margin: 0;
    line-height: 1.4;
    text-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.8),
        0 4px 20px rgba(0, 0, 0, 0.6);
    word-wrap: break-word;
    position: relative;
    z-index: 3;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.9;
    }
}

.imagen-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    font-size: 1rem;
}


/* Estado vacío mejorado */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.empty-state p {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Formulario */
.form-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.form-section h2 {
    margin-bottom: 1.5rem;
    color: #333;
    border-bottom: 3px solid;
    border-image: var(--primary-gold-gradient) 1;
    padding-bottom: 0.5rem;
}

.form-proyecto {
    max-width: 600px;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="file"] {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input[type="text"]:focus,
.form-group input[type="file"]:focus {
    outline: none;
    border-color: var(--gold-color);
    box-shadow: 0 0 0 3px rgba(159, 124, 53, 0.1);
    transform: translateY(-2px);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.85rem;
}

/* Tabla */
.tabla-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tabla-section h2 {
    margin-bottom: 1.5rem;
    color: #333;
    border-bottom: 3px solid;
    border-image: var(--primary-gold-gradient) 1;
    padding-bottom: 0.5rem;
}

.table-container {
    overflow-x: auto;
}

.tabla-proyectos {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.tabla-proyectos th,
.tabla-proyectos td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.tabla-proyectos th {
    background: var(--primary-gradient);
    color: var(--white-color);
    font-weight: 600;
}

.tabla-proyectos tr:hover {
    background-color: rgba(172, 37, 42, 0.05);
    transform: scale(1.01);
    transition: all 0.2s ease;
}

.thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.sin-imagen {
    color: #999;
    font-size: 0.85rem;
}

.ruta {
    max-width: 300px;
    word-break: break-all;
}

.ruta a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.ruta a:hover {
    text-decoration: underline;
    color: var(--gold-color);
}

/* Mensajes */
.mensaje {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.mensaje.exito {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mensaje.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Footer mejorado */
footer {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

footer p {
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .catalogo-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 2rem;
    }

    .proyecto-card {
        padding: 1.5rem;
        border-radius: 40px;
    }

    .proyecto-imagen {
        width: 100%;
        height: 100%;
    }

    .nombre-proyecto-overlay {
        font-size: 1.4rem;
    }

    .tabla-proyectos {
        font-size: 0.9rem;
    }

    .tabla-proyectos th,
    .tabla-proyectos td {
        padding: 0.5rem;
    }

    .bubble {
        display: none;
    }
}

@media (max-width: 480px) {
    .catalogo-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .nombre-proyecto-overlay {
        font-size: 1.2rem;
        padding: 1.5rem;
    }
}

/* Animación de carga */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading {
    animation: shimmer 2s infinite;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 1000px 100%;
}
