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

html, body {
    height: 100%;
    font-family: 'Poppins', Arial, Helvetica, sans-serif;
    background-color: #E5ECFF;
    color: #222;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    margin: 0;
    padding: 0;
}

footer {
    margin: 0;
    padding: 1.8rem 2rem;
}

/* --- SECTION COLLECTIONS --- */
#collections {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* Header con título y filtro */
.collections-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.collections-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1746D2;
    margin: 0;
}

/* Filtro mejorado */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: #fff;
    padding: 0.8rem 1.2rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid rgba(47, 96, 244, 0.1);
}

.filter-bar label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #555;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-bar label i {
    color: #2F60F4;
    font-size: 0.9rem;
}

.filter-bar select {
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 0.95rem;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 160px;
}

.filter-bar select:focus {
    outline: none;
    border-color: #2F60F4;
    box-shadow: 0 0 0 3px rgba(47, 96, 244, 0.1);
}

/* --- ESTADO VACÍO - CUANDO NO HAY COLECCIONES --- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin: 2rem auto;
    max-width: 600px;
}

.empty-state i {
    font-size: 5rem;
    color: #2F60F4;
    opacity: 0.3;
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    font-size: 1.75rem;
    color: #333;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.empty-state p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.6;
    max-width: 400px;
}

.btn-create-first {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.8rem;
    background: linear-gradient(135deg, #2F60F4 0%, #1746D2 100%);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(47, 96, 244, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-create-first:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(47, 96, 244, 0.35);
    color: #fff;
}

.btn-create-first:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(47, 96, 244, 0.25);
}

.btn-create-first i {
    font-size: 1rem;
    color: #fff;
    opacity: 1;
    margin: 0;
}

/* --- GRID DE CARDS --- */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

/* --- CARD INDIVIDUAL --- */
.card {
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(47, 96, 244, 0.08);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(47, 96, 244, 0.15);
    border-color: rgba(47, 96, 244, 0.2);
}

/* Link clickeable */
.card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Imagen / Fallback con gradiente */
.card-image-wrapper {
    width: 100%;
    height: 160px;
    overflow: hidden;
    position: relative;
}

.card-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2F60F4 0%, #1746D2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.card-fallback::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.card-initial {
    font-size: 3.5rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 1;
    position: relative;
}

/* Contenido de la card */
.card-content {
    padding: 1.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex-grow: 1;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-description {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

/* Footer con badge */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.card-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    background: rgba(47, 96, 244, 0.08);
    color: #2F60F4;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.card-badge i {
    font-size: 0.75rem;
}

/* --- PAGINACIÓN --- */
#pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
}

.pagination-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #2F60F4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    text-decoration: none;
    border: 2px solid rgba(47, 96, 244, 0.12);
}

.pagination-arrow:hover:not(.disabled) {
    background: #2F60F4;
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 4px 10px rgba(47, 96, 244, 0.25);
    border-color: #2F60F4;
}

.pagination-arrow.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: #f5f5f5;
    color: #999;
    border-color: #e0e0e0;
}

.pagination-page-number {
    min-width: 90px;
    height: 40px;
    border-radius: 8px;
    background: #fff;
    color: #333;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    border: 2px solid rgba(47, 96, 244, 0.08);
}

.pagination-page-number span {
    font-size: 0.875rem;
    font-weight: 400;
    color: #666;
}

.pagination-page-number strong {
    font-size: 0.875rem;
    color: #2F60F4;
    font-weight: 600;
    margin-left: 0.25rem;
}

/* --- FAB CREAR COLECCIÓN --- */
.fab-create {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2F60F4 0%, #1746D2 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 16px rgba(47, 96, 244, 0.35);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 1000;
    text-decoration: none;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.fab-create:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 22px rgba(47, 96, 244, 0.45);
    color: #fff;
}

.fab-create:active {
    transform: scale(1.02) rotate(90deg);
    color: #fff;
}

/* --- RESPONSIVE --- */
@media (max-width: 1400px) {
    .cards-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 1024px) {
    .collections-header h1 {
        font-size: 2rem;
    }

    .cards-container {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1.2rem;
    }
}

@media (max-width: 768px) {
    #collections {
        padding: 1.5rem;
    }

    .collections-header {
        margin-top: 5rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-bar {
        width: 100%;
        justify-content: space-between;
    }

    .cards-container {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }

    .empty-state {
        min-height: 50vh;
        padding: 2rem 1.5rem;
    }

    .empty-state i {
        font-size: 3.5rem;
    }

    .empty-state h3 {
        font-size: 1.4rem;
    }

    .empty-state p {
        font-size: 0.95rem;
    }
}

@media (max-width: 600px) {
    .collections-header h1 {
        font-size: 1.8rem;
    }

    .cards-container {
        grid-template-columns: 1fr;
    }

    .card-image-wrapper {
        height: 140px;
    }
}