/* ============================================================
   DECK LIST — Partenope Duel Format
   ============================================================ */

.dl-page {
    padding-top: 64px;
    min-height: 100vh;
}

/* --- Hero ------------------------------------------------ */
.dl-hero {
    position: relative;
    padding: 60px 0 40px;
    text-align: center;
    overflow: hidden;
}
.dl-hero__title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.dl-hero__title i { color: var(--coral); }
.dl-hero__subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

/* --- Container ------------------------------------------- */
.dl-container {
    padding: 24px 24px 60px;
    max-width: 1200px;
}

/* --- Toolbar --------------------------------------------- */
.dl-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* --- Search ---------------------------------------------- */
.dl-search {
    position: relative;
    flex: 1;
    min-width: 220px;
}
.dl-search__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: .85rem;
    pointer-events: none;
}
.dl-search__input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: .88rem;
    outline: none;
    transition: border-color var(--transition);
}
.dl-search__input:focus { border-color: var(--coral); }
.dl-search__input::placeholder { color: var(--text-muted); }

/* --- Filters --------------------------------------------- */
.dl-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.dl-filter {
    padding: 8px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.dl-filter:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}
.dl-filter--active {
    background: rgba(232, 96, 90, .1);
    border-color: var(--coral);
    color: var(--coral);
}

/* --- Grid ------------------------------------------------ */
.dl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

/* --- Deck Card ------------------------------------------- */
.dl-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color var(--transition), transform .15s ease;
    cursor: pointer;
}
.dl-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.dl-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.dl-card__name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}
.dl-card__format {
    padding: 3px 10px;
    border-radius: 100px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    flex-shrink: 0;
}
.dl-card__format--edison {
    background: rgba(232, 96, 90, .15);
    color: var(--coral);
    border: 1px solid rgba(232, 96, 90, .25);
}
.dl-card__format--goat {
    background: rgba(255, 193, 7, .12);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, .2);
}

.dl-card__author {
    font-size: .8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.dl-card__author i { color: var(--coral); font-size: .75rem; }
.dl-card__has-desc {
    margin-left: auto;
    color: var(--text-muted);
    font-size: .7rem;
}
.dl-card__has-desc i { color: var(--text-muted); }

.dl-card__counts {
    display: flex;
    gap: 12px;
    font-size: .78rem;
    color: var(--text-secondary);
    font-weight: 600;
}
.dl-card__counts span {
    display: flex;
    align-items: center;
    gap: 4px;
}
.dl-card__counts i {
    color: var(--text-muted);
    font-size: .7rem;
}

.dl-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.dl-card__date {
    font-size: .72rem;
    color: var(--text-muted);
}
.dl-card__actions {
    display: flex;
    gap: 6px;
}
.dl-card__btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: .8rem;
    cursor: pointer;
    transition: all var(--transition);
}
.dl-card__btn:hover {
    border-color: var(--coral);
    color: var(--coral);
}

/* --- Loading / Empty ------------------------------------- */
.dl-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 0;
    color: var(--text-muted);
    grid-column: 1 / -1;
}
.dl-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 80px 0;
    color: var(--text-muted);
    text-align: center;
}
.dl-empty i { font-size: 2.5rem; opacity: .3; }
.dl-empty p { font-size: 1rem; }

/* --- Pagination ------------------------------------------ */
.dl-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
}
.dl-page-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.dl-page-btn:hover {
    border-color: var(--coral);
    color: var(--coral);
}
.dl-page-btn--active {
    background: rgba(232, 96, 90, .15);
    border-color: var(--coral);
    color: var(--coral);
}

/* --- Modal ----------------------------------------------- */
.dl-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.dl-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(4px);
}
.dl-modal__content {
    position: relative;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.dl-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}
.dl-modal__header h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
}
.dl-modal__meta {
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.dl-modal__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.dl-modal__close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition);
}
.dl-modal__close:hover {
    border-color: var(--coral);
    color: var(--coral);
}
.dl-modal__body {
    padding: 20px 24px;
    overflow-y: auto;
}

/* --- Flip Card Effect ------------------------------------ */
.dl-modal__flipper {
    flex: 1;
    overflow: hidden;
    position: relative;
    perspective: 1200px;
}
.dl-modal__front,
.dl-modal__back {
    width: 100%;
    min-height: 100%;
    backface-visibility: hidden;
    transition: transform .6s cubic-bezier(.4, 0, .2, 1);
}
.dl-modal__front {
    padding: 20px 24px;
    overflow-y: auto;
    max-height: 70vh;
}
.dl-modal__back {
    position: absolute;
    inset: 0;
    transform: rotateY(180deg);
    overflow-y: auto;
    padding: 20px 24px;
}
.dl-modal__flipper--flipped .dl-modal__front {
    transform: rotateY(-180deg);
    pointer-events: none;
}
.dl-modal__flipper--flipped .dl-modal__back {
    transform: rotateY(0deg);
}

/* Flip button */
.dl-flip-btn i {
    transition: transform .3s ease;
}
.dl-modal__flipper--flipped ~ .dl-modal__header .dl-flip-btn i,
.dl-flip-btn:hover i {
    transform: rotate(180deg);
}

/* --- Description (back side) ----------------------------- */
.dl-description {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 0;
}
.dl-description__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.dl-description__header i {
    font-size: 1.4rem;
    color: var(--coral);
}
.dl-description__header h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
}
.dl-description__text {
    font-size: .9rem;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}

/* --- Modal Deck Sections --------------------------------- */
.dl-deck-section {
    margin-bottom: 20px;
}
.dl-deck-section__title {
    font-family: var(--font-display);
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--coral);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dl-deck-section__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.dl-deck-card {
    width: 59px;
    height: 86px;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}
.dl-deck-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.dl-deck-card:hover {
    transform: scale(1.08);
    z-index: 5;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .5);
    transition: transform .15s ease;
}

/* --- Spinner (reuse from deckbuilder) -------------------- */
.db-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--coral);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Responsive ------------------------------------------ */
@media (max-width: 768px) {
    .dl-page { padding-top: 56px; }
    .dl-hero { padding: 40px 0 24px; }
    .dl-hero__title { font-size: 1.4rem; letter-spacing: 2px; }
    .dl-hero__subtitle { font-size: .85rem; }
    .dl-container { padding: 16px 16px 40px; }

    .dl-grid { grid-template-columns: 1fr; gap: 12px; }

    .dl-card { padding: 16px; gap: 10px; }
    .dl-card__name { font-size: .95rem; }
    .dl-card__counts { gap: 8px; font-size: .72rem; }
    .dl-card__format { font-size: .65rem; padding: 2px 8px; }

    .dl-toolbar { flex-direction: column; gap: 10px; }
    .dl-search { min-width: 0; width: 100%; }
    .dl-filters { gap: 6px; width: 100%; }
    .dl-filter { padding: 6px 14px; font-size: .8rem; }

    .dl-modal__content { max-width: 100%; margin: 0 8px; max-height: 90vh; }
    .dl-modal__header { padding: 16px; flex-wrap: wrap; gap: 10px; }
    .dl-modal__header h2 { font-size: .95rem; }
    .dl-modal__actions { width: 100%; justify-content: flex-end; }
    .dl-modal__body { padding: 16px; }
    .dl-modal__front { padding: 16px; max-height: 75vh; }
    .dl-modal__back { padding: 16px; }
    .dl-flip-btn__text { display: none; }

    .dl-deck-card { width: 50px; height: 73px; }
    .dl-deck-section__title { font-size: .78rem; }

    .dl-pagination { gap: 4px; margin-top: 24px; }
    .dl-page-btn { width: 32px; height: 32px; font-size: .8rem; }
}

@media (max-width: 480px) {
    .dl-hero { padding: 32px 0 20px; }
    .dl-hero__title { font-size: 1.2rem; }
    .dl-container { padding: 12px 12px 32px; }

    .dl-card { padding: 14px; }
    .dl-card__name { font-size: .88rem; }
    .dl-card__author { font-size: .72rem; }
    .dl-card__counts { font-size: .68rem; }
    .dl-card__date { font-size: .65rem; }
    .dl-card__btn { width: 28px; height: 28px; font-size: .7rem; }

    .dl-deck-card { width: 42px; height: 61px; }
    .dl-deck-section__grid { gap: 3px; }

    .dl-modal { padding: 8px; }
    .dl-modal__header h2 { font-size: .85rem; letter-spacing: 1px; }
    .btn--sm { padding: 6px 12px; font-size: .75rem; }
}
