/* ==========================================
   CARD LIST PAGE STYLES
   Follows comparison calculator aesthetic
   ========================================== */

/* Main Container */
.card-list-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out;
}

.card-list-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #4a6fa5 0%, #5a9f68 50%, #d4a44c 100%);
}

.card-list-header {
    text-align: center;
    margin-bottom: 1rem;
}

.card-list-header h1 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin: 0;
}

.card-list-header p {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Mobile Filter Button */
.mobile-filter-btn {
    display: none;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    align-items: center;
    gap: 0.5rem;
}

.mobile-filter-btn:hover {
    background: var(--primary-dark);
}

.filter-icon iconify-icon {
    font-size: 1rem;
    vertical-align: -0.1em;
}

/* ==========================================
   LAYOUT (DESKTOP: SIDEBAR + MAIN)
   ========================================== */
.card-list-layout {
    display: flex;
    gap: 1.5rem;
}

.card-list-main {
    flex: 1;
    min-width: 0;
}

/* ==========================================
   FILTERS SIDEBAR
   ========================================== */
.filters-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    height: fit-content;
    position: sticky;
    top: 20px;
    box-shadow: var(--shadow-sm);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.filters-header h3 {
    font-size: 1rem;
    color: var(--secondary-color);
    margin: 0;
}

.close-filters-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
    transition: var(--transition-smooth);
}

.close-filters-btn:hover {
    color: var(--primary-color);
}

.filters-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 0;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.4rem 0.5rem;
    border-radius: 5px;
    transition: var(--transition-smooth);
}

.filter-checkbox:hover {
    background: linear-gradient(135deg, #f0f4f8 0%, #e8eef4 100%);
}

.filter-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

.checkbox-label {
    font-size: 0.85rem;
    color: var(--text-color);
    cursor: pointer;
    user-select: none;
}

.filter-actions {
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.filter-actions .btn {
    width: 100%;
    justify-content: center;
}

/* ==========================================
   CARDS TABLE / LIST
   ========================================== */
.cards-count {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.cards-count strong {
    color: var(--primary-color);
}

.cards-table {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: var(--transition-smooth);
    text-decoration: none;
    color: inherit;
}

.card-row:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.card-row-image {
    width: 70px;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.card-row-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.card-row-bank {
    font-size: 0.65rem;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-row-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.card-row-details {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

.card-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 80px;
}

.card-detail-label {
    font-size: 0.6rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.1rem;
}

.card-detail-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
}

.card-detail-value.free {
    color: var(--success-color);
}

.card-detail-value.income {
    color: var(--primary-color);
}

.card-row-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-calc {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-calc:hover {
    box-shadow: 0 4px 12px rgba(74, 111, 165, 0.35);
    transform: translateY(-1px);
}

.btn-external {
    padding: 0.5rem;
    font-size: 0.85rem;
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-external:hover {
    border-color: var(--primary-light);
    color: var(--primary-color);
    background: linear-gradient(135deg, #f0f4f8 0%, #e8eef4 100%);
}

/* No Results */
.no-cards-message {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.no-cards-message iconify-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-cards-message p {
    margin: 0;
    font-size: 0.9rem;
}

/* ==========================================
   MOBILE RESPONSIVE
   ========================================== */
@media (max-width: 900px) {
    .card-row-details {
        gap: 1rem;
    }
    
    .card-detail {
        min-width: 70px;
    }
}

@media (max-width: 768px) {
    .card-list-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
    
    .card-list-header p {
        display: none;
    }
    
    .mobile-filter-btn {
        display: flex;
    }
    
    .card-list-layout {
        display: block;
    }
    
    /* Filters sidebar slides in from right */
    .filters-sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        z-index: 1001;
        transition: right 0.3s ease;
        border-radius: 0;
        overflow-y: auto;
        box-shadow: var(--shadow-lg);
    }
    
    .filters-sidebar.active {
        right: 0;
    }
    
    .close-filters-btn {
        display: block;
    }
    
    .card-list-container {
        padding: 1rem;
    }
    
    .card-list-header h1 {
        font-size: 1.25rem;
    }
}

@media (max-width: 600px) {
    .card-row {
        padding: 0.6rem 0.75rem;
        gap: 0.75rem;
    }
    
    .card-row-image {
        width: 50px;
    }
    
    .card-row-name {
        font-size: 0.85rem;
    }
    
    .card-row-bank {
        font-size: 0.55rem;
    }
    
    .card-row-details {
        display: none;
    }
    
    .card-row-actions {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn-calc {
        padding: 0.4rem 0.75rem;
        font-size: 0.7rem;
    }
    
    .btn-external {
        display: none;
    }
}

/* Overlay background for mobile filters */
.filters-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filters-overlay.active {
    display: block;
    opacity: 1;
}
