/*
  Bank Page Styles
  Card grid layout, rich visual feedback, professional aesthetic.
*/

:root {
    --header-bg: #f0f7ff;
    /* Soft blue tint */
    --highlight: var(--primary, #4a84dc);
    /* Theme primary */
    --card-bg: #ffffff;
    --text-title: #1e293b;
    --text-body: #475569;
    --text-meta: #64748b;
    --tag-bg: #f1f5f9;
    --tag-text: #475569;
}

.bank-shell {
    width: min(var(--content-max-width, 1200px), calc(100vw - var(--content-gutter, 48px)));
    margin: 0 auto;
    padding-bottom: 60px;
}

@keyframes bankFadeInUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 1. Header Banner */
.bank-banner {
    position: relative;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 32px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    animation: bankFadeInUp 460ms ease both;
}

.banner-bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 60%;
    background: url('/static/assets/bank-header-bg.png') no-repeat right center;
    background-size: cover;
    opacity: 1;
    mask-image: linear-gradient(to right, transparent 10%, black 60%);
    -webkit-mask-image: linear-gradient(to right, transparent 10%, black 60%);
    pointer-events: none;
}

.banner-content {
    position: relative;
    padding: 48px 40px;
    max-width: 600px;
    z-index: 2;
}

.banner-title {
    font-size: 32px;
    font-weight: 800;
    color: #1e3a8a;
    /* Deep blue */
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
}

.banner-desc {
    font-size: 16px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 24px;
}

.bank-stats {
    display: flex;
    gap: 24px;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    color: var(--text-meta);
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.stat-pill b {
    color: var(--highlight);
    font-size: 15px;
}

/* 2. Controls & Filter Bar */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    animation: bankFadeInUp 520ms ease both;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-title);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 3. Set Grid Styling */
.set-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.set-card {
    background: var(--card-bg);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
    animation: bankFadeInUp 520ms ease both;
}

.set-card:nth-child(2) {
    animation-delay: 70ms;
}

.set-card:nth-child(3) {
    animation-delay: 120ms;
}

.set-card:nth-child(4) {
    animation-delay: 170ms;
}

.set-card:nth-child(5) {
    animation-delay: 220ms;
}

.set-card:nth-child(6) {
    animation-delay: 270ms;
}

.set-card:nth-child(7) {
    animation-delay: 320ms;
}

.set-card:nth-child(8) {
    animation-delay: 370ms;
}

.set-card:nth-child(9) {
    animation-delay: 420ms;
}

.set-card:nth-child(10) {
    animation-delay: 470ms;
}

.set-card:nth-child(n+11) {
    animation-delay: 520ms;
}

@media (prefers-reduced-motion: reduce) {

    .bank-banner,
    .filter-bar,
    .set-card {
        animation: none !important;
    }
}

.set-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    /* Subtle shadow only */
    border-color: #cbd5e1;
}

/* Cover Image Area */
.card-cover {
    height: 140px;
    background: transparent;
    border-bottom: 1px solid #eef2f7;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-cover img {
    width: 74px;
    height: 74px;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.set-card:hover .card-cover img {
    transform: scale(1.05);
    /* Zoom effect */
}

.difficulty-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #475569;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.difficulty-badge.easy {
    color: #166534;
    background: #dcfce7;
}

.difficulty-badge.normal {
    color: #1e40af;
    background: #dbeafe;
}

.difficulty-badge.hard {
    color: #991b1b;
    background: #fee2e2;
}

/* Content Body */
.card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-title);
    line-height: 1.3;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.meta-tag {
    font-size: 12px;
    color: var(--tag-text);
    background: var(--tag-bg);
    padding: 2px 8px;
    border-radius: 4px;
}

.card-desc {
    font-size: 13px;
    color: var(--text-body);
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
    /* Pushes footer down */
}

/* Footer Actions */
.card-footer {
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.btn-start {
    background: var(--highlight);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
}

.btn-start:hover {
    background: var(--primary-dark, #366fc8);
}

.btn-detail {
    padding: 8px;
    color: var(--text-meta);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.btn-detail:hover {
    color: var(--text-title);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px;
    grid-column: 1 / -1;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
    color: var(--text-meta);
}

/* Responsive */
@media (max-width: 768px) {
    .banner-bg {
        width: 100%;
        opacity: 0.1;
    }

    .banner-content {
        text-align: center;
    }

    .bank-stats {
        justify-content: center;
    }

    .set-grid {
        grid-template-columns: 1fr;
    }
}