@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #00f2fe;
    --secondary-color: #4facfe;
    --bg-color: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-color: #ffffff;
    --text-muted: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border_box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(79, 172, 254, 0.2) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(0, 242, 254, 0.15) 0%, transparent 20%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    /* Móvil por defecto */
}

@media (min-width: 768px) {
    body {
        padding: 2rem;
    }
}

.container {
    width: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2.2rem;
    /* Móvil */
    font-weight: 700;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
    line-height: 1.2;
}

@media (min-width: 768px) {
    h1 {
        font-size: 3.5rem;
        /* Desktop */
    }
}

p.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
}

@media (min-width: 768px) {
    p.subtitle {
        font-size: 1.2rem;
    }
}

/* Glassmorphism Card (General) */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .glass-card {
        padding: 3rem;
    }
}

/* Upload Section */
.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    border: 2px dashed var(--card-border);
    border-radius: 15px;
    padding: 2.5rem 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .upload-area {
        padding: 4rem 2rem;
        gap: 1.5rem;
    }
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(0, 242, 254, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--secondary-color);
}

@media (min-width: 768px) {
    .upload-icon {
        font-size: 4.5rem;
    }
}

.upload-text h3 {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.btn-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (min-width: 768px) {
    .btn-group {
        flex-direction: row;
        width: auto;
        margin-top: 2rem;
    }
}

.btn {
    padding: 1rem 1.5rem;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    width: 100%;
}

@media (min-width: 768px) {
    .btn {
        width: auto;
        padding: 1rem 2rem;
        font-size: 0.9rem;
    }
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.2);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid var(--card-border);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 242, 254, 0.3);
}

/* Inputs */
.input-group {
    margin-top: 1.5rem;
    width: 100%;
}

/* Actualización: Fix Textarea & Accordion Mobile */

/* 1. Fix Textarea Overflow */
textarea {
    width: 100%;
    max-width: 100%;
    /* Evita desborde */
    box-sizing: border-box;
    /* Crucial para padding */
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    padding: 1.2rem;
    color: white;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.3s;
    font-size: 0.95rem;
    line-height: 1.5;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.4);
}

/* Preview */
.preview-container {
    margin-top: 2rem;
    display: none;
    text-align: center;
}

.preview-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 15px;
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Gallery Section */
.gallery-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

/* Gallery Package Styles */
.gallery-package {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 1rem;
    margin-bottom: 3rem;
    animation: slideInFromTop 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .gallery-package {
        border-radius: 30px;
        padding: 2.5rem;
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    }
}

.gallery-package::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(140deg, rgba(79, 172, 254, 0.03) 0%, transparent 60%);
    pointer-events: none;
}

/* 2. Estilos para Acordeón (Collapsible) */
.package-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    /* Quitamos margen porque ahora es un toggle */
    padding-bottom: 0;
    border-bottom: none;
    cursor: pointer;
    /* Indicar interactividad */
    transition: background 0.3s;
    padding: 0.5rem;
    border-radius: 15px;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gallery-package.is-open .package-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    background: transparent;
}

/* Header Thumbnail (La foto chiquita) */
.header-thumb {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid var(--card-border);
    margin-right: 1rem;
    flex-shrink: 0;
}

.header-info {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.toggle-icon {
    font-size: 1.2rem;
    color: var(--secondary-color);
    transition: transform 0.3s ease;
    margin-left: 1rem;
}

/* Rotar flecha al abrir */
.gallery-package.is-open .toggle-icon {
    transform: rotate(180deg);
}

/* Contenido Colapsable */
.package-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
    opacity: 0;
}

/* Estado Abierto */
.gallery-package.is-open .package-content {
    max-height: 2000px;
    /* Altura suficiente */
    opacity: 1;
}

/* Escritorio: Podemos hacer que esté abierto por defecto o mantener el toggle.
   Para consistencia y limpieza, mantendremos el toggle "open" por defecto en JS si se desea,
   o dejamos el comportamiento manual. El usuario pidió "en versión movil", 
   pero un acordeón suele ser útil en todos lados. Defaut: Cerrado (mobile feel) o Abierto?
   Vamos a forzar que en desktop se vea abierto por defecto si se prefiere, 
   pero el usuario busca "identificar mas facil", así que la miniatura ayuda mucho.
*/
.package-time {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    flex-direction: column;
    /* Apilar texto si es necesario */
    align-items: flex-start;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .package-header {
        padding: 0;
        /* Reset en desktop si queremos menos "botón" look */
    }

    .gallery-package.is-open .package-header {
        padding-bottom: 1rem;
    }

    /* En desktop, la miniatura puede ser un poco más grande */
    .header-thumb {
        width: 60px;
        height: 60px;
    }

    .package-time {
        font-size: 1.1rem;
        flex-direction: row;
        gap: 1rem;
    }
}

.package-time::before {
    content: '\f017';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    opacity: 0.7;
}

/* Grid de Imágenes */
.package-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

@media (min-width: 768px) {
    .package-images {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 2rem;
    }
}

@media (min-width: 1600px) {
    .package-images {
        gap: 3rem;
        grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    }
}

.package-image-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

@media (min-width: 768px) {
    .package-image-item {
        border-radius: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }
}

.package-image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(0, 242, 254, 0.2);
    border-color: rgba(0, 242, 254, 0.4);
    z-index: 10;
}

@media (min-width: 768px) {
    .package-image-item:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6),
            0 0 30px rgba(0, 242, 254, 0.2);
    }
}

.package-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.package-image-item:hover img {
    transform: scale(1.1);
}

.img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .img-overlay {
        background: rgba(15, 23, 42, 0.7);
        backdrop-filter: blur(8px);
        gap: 1.5rem;
    }
}

.package-image-item:hover .img-overlay,
.package-image-item:active .img-overlay {
    opacity: 1;
    transform: scale(1);
}

.action-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    backdrop-filter: blur(5px);
}

@media (min-width: 768px) {
    .action-btn {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        background: rgba(255, 255, 255, 0.05);
    }
}

.action-btn:hover {
    background: var(--primary-color);
    color: #000;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 242, 254, 0.4);
    border-color: var(--primary-color);
}

.image-label {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 10%, transparent);
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.5px;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

@media (min-width: 768px) {
    .image-label {
        bottom: 20px;
        padding: 0 10px;
        background: transparent;
        color: rgba(255, 255, 255, 0.9);
        font-size: 0.9rem;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    }
}

.package-image-item:hover .image-label {
    opacity: 0;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

.loading-overlay h2,
.loading-overlay p {
    text-align: center;
    color: white;
    max-width: 90%;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .spinner {
        width: 60px;
        height: 60px;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {
    display: none !important;
}