/* ========================================
   NEW CARD DETAILS MODAL
   ======================================== */

.card-details-content {
    width: 1000px;
    max-width: 95vw;
    height: 650px;
    max-height: 90vh;
    padding: 0;
    display: flex;
    overflow: hidden;
    border-radius: 24px;
    background: white;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.card-details-left {
    width: 380px;
    background: #F8FAFC;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid #E2E8F0;
    flex-shrink: 0;
}

.card-details-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    padding: 0;
}

.card-visual-container {
    margin-bottom: 2rem;
    width: 100%;
    display: flex;
    justify-content: center;
}

.match-badge {
    background: white;
    border: 1px solid #E2E8F0;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: #1F2937;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
}

.card-details-header {
    padding: 2rem 2rem 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.modal-close-desktop {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #94A3B8;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close-desktop:hover {
    background: #F1F5F9;
    color: #1F2937;
}

.modal-close-mobile {
    display: none;
}

/* Tabs */
.card-tabs {
    display: flex;
    gap: 2rem;
    padding: 0 2rem;
    border-bottom: 1px solid #E2E8F0;
    margin-top: 1rem;
}

.card-tab {
    background: none;
    border: none;
    padding: 1rem 0;
    font-weight: 600;
    color: #64748B;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.card-tab:hover {
    color: #1F2937;
}

.card-tab.active {
    color: #6366F1;
    border-bottom-color: #6366F1;
}

.card-tab .material-icons {
    font-size: 20px;
}

/* Tab Content */
.card-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Freak Verdict */
.freak-verdict {
    background: #F5F3FF;
    border: 1px solid #E0E7FF;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.verdict-icon {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366F1;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.1);
}

.verdict-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: #4338CA;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.verdict-text {
    color: #3730A3;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Welcome Offer */
.welcome-offer-box {
    background: #F8FAFC;
    border: 1px solid #F1F5F9;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: baseline;
}

/* Stats Grid */
.stat-box {
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 1.25rem;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #94A3B8;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1F2937;
}

/* Earning Rows */
.pro-tip {
    background: #FFFBEB;
    color: #92400E;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    line-height: 1.5;
}

/* Expandable Row Wrapper */
.expandable-row-wrapper {
    border-bottom: 1px solid #F1F5F9;
    transition: all 0.2s ease;
}

.expandable-row-wrapper:last-child {
    border-bottom: none;
}

.expandable-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.expandable-row:hover {
    background: #F9FAFB;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    border-radius: 8px;
}

.earning-cat {
    font-weight: 600;
    color: #1F2937;
    font-size: 1rem;
}

.earning-mult {
    background: #EFF6FF;
    color: #2563EB;
    font-weight: 700;
    padding: 0.375rem 0.875rem;
    border-radius: 8px;
    font-size: 0.95rem;
}

/* Expandable Content */
.expandable-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.expandable-row-wrapper.expanded .expandable-content {
    max-height: 500px;
}

.expandable-content-inner {
    padding: 0 0 1.25rem 0;
    color: #64748B;
    font-size: 0.9rem;
    line-height: 1.6;
}

.expand-arrow {
    transition: transform 0.3s ease;
}

/* Benefit Value Styles */
.benefit-value {
    font-weight: 700;
    padding: 0.375rem 0.875rem;
    border-radius: 8px;
    font-size: 0.95rem;
}

.benefit-value-money {
    background: #ECFDF5;
    color: #059669;
}

.benefit-value-included {
    background: #F3F4F6;
    color: #6B7280;
}

.benefit-value-extra {
    background: #FEF3C7;
    color: #D97706;
}

/* Legacy earning row styles (kept for compatibility) */
.earning-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #F1F5F9;
}

.earning-row:last-child {
    border-bottom: none;
}

/* Action Buttons */
.card-actions {
    margin-top: auto;
    padding: 1.5rem 2rem;
    /* Match header padding */
    border-top: 1px solid #E2E8F0;
    display: flex;
    gap: 1rem;
    background: white;
}

.btn-add-wallet {
    flex: 1;
    background: #111827;
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-add-wallet:hover {
    background: #000;
    transform: translateY(-1px);
}

.btn-apply {
    flex: 1;
    background: #EFF6FF;
    /* Light blue background for Apply Now */
    color: #2563EB;
    /* Blue text */
    border: none;
    /* No border */
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-apply:hover {
    background: #DBEAFE;
}


/* ========================================
   MOBILE RESPONSIVE MODAL
   ======================================== */
@media (max-width: 768px) {
    .modal {
        padding: 0 !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 9999 !important;
    }

    .card-details-content {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        flex-direction: column;
        overflow-y: auto;
        padding-bottom: 80px;
        margin: 0;
        /* Space for sticky footer */
    }

    .card-details-left {
        width: 100%;
        padding: 2rem 1.5rem 1rem 1.5rem;
        border-right: none;
        border-bottom: 1px solid #E2E8F0;
        background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
    }

    .card-details-right {
        overflow: visible;
    }

    .card-details-header {
        padding: 2rem 1.5rem 1rem 1.5rem;
        /* Increased top padding for correct spacing */
    }

    .modal-close-desktop {
        display: none;
    }

    .modal-close-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        /* Fixed to viewport */
        top: 1rem;
        right: 1rem;
        background: white;
        border: 1px solid #E2E8F0;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        font-size: 1.75rem;
        line-height: 1;
        color: #64748B;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        z-index: 99999;
        /* Ensure on top of everything */
        cursor: pointer;
    }

    .card-tabs {
        padding: 0 1.5rem;
        gap: 1.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .card-tab {
        white-space: nowrap;
        padding: 0.75rem 0;
    }

    /* Force row layout for earning/benefits on mobile to override style.css */
    .expandable-row {
        flex-direction: row !important;
        align-items: center !important;
        padding: 1.25rem 0 !important;
        gap: 0 !important;
        justify-content: space-between !important;

        /* Reset styles from style.css leakage ONLY for mobile */
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        box-shadow: none !important;
    }

    .expandable-row>div:last-child {
        width: auto !important;
    }

    .card-tab-content {
        padding: 1.5rem 2rem 8rem 2rem;
        /* Increased side padding and button space */
    }

    /* Sticky Footer for Mobile */
    .card-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: white;
        padding: 1rem 1.5rem;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
        z-index: 100;
        flex-direction: row;
        /* Side by side on mobile */
        gap: 1rem;
        margin-top: 0;
    }

    .card-actions .btn-add-wallet,
    .card-actions .btn-apply {
        flex: 1;
    }

    /* Adjust visual scale for mobile */
    .card-actions .btn-add-wallet,
    .card-actions #modal-card-visual {
        transform: scale(0.85) !important;
        margin-bottom: -1rem !important;
    }
}

/* ========================================
   MOBILE WALLET STYLES
   ======================================== */

.wallet-header-mobile {
    display: none;
}

.wallet-mobile-list {
    display: none;
}

.wallet-card-icon {
    width: 60px;
    height: 40px;
    border-radius: 8px;
    flex-shrink: 0;
}

.card-icon-gray {
    background: linear-gradient(135deg, #CBD5E1 0%, #94A3B8 100%);
}

.card-icon-blue {
    background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 100%);
}

.card-icon-gold {
    background: linear-gradient(135deg, #FCD34D 0%, #F59E0B 100%);
}

.wallet-list-item {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.wallet-list-info {
    flex: 1;
}

.wallet-list-name {
    font-weight: 700;
    color: #1F2937;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.wallet-list-num {
    color: #64748B;
    font-size: 0.875rem;
}

.wallet-list-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .wallet-header-mobile {
        display: block;
    }

    .wallet-mobile-list {
        display: block;
    }

    .desktop-only {
        display: none !important;
    }

    .grid-cards {
        display: none !important;
    }
}

/* ========================================
   ADD CARD MODAL STYLES
   ======================================== */

.add-card-content {
    width: 900px;
    max-width: 95vw;
    height: 600px;
    max-height: 90vh;
    padding: 0;
    display: flex;
    overflow: hidden;
    border-radius: 24px;
    background: white;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.add-card-mobile-view {
    display: none;
}

.add-card-detail-view {
    display: none;
}

.add-card-left {
    width: 350px;
    background: white;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #E2E8F0;
    flex-shrink: 0;
}

.add-card-right {
    flex: 1;
    background: #F8FAFC;
    overflow: hidden;
}

/* Search */
.search-container {
    position: relative;
    margin-bottom: 2rem;
}

.search-container .material-icons {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 20px;
}

.search-container input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
    background: white;
}

.search-container input:focus {
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Filter Pills */
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-pill {
    background: white;
    border: 1px solid #E2E8F0;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748B;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-pill:hover {
    border-color: #CBD5E1;
    color: #1F2937;
}

.filter-pill.active {
    background: #1F2937;
    border-color: #1F2937;
    color: white;
}

/* Card List */
.add-card-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-right: 0.5rem;
}

.add-card-list-item {
    padding: 1rem;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.add-card-list-item:hover {
    border-color: #6366F1;
    background: #F8FAFC;
}

.add-card-list-item.active {
    border: 2px solid #6366F1;
    background: #EFF6FF;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .add-card-content {
        flex-direction: column;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .add-card-left {
        width: 100%;
        height: 50%;
        border-right: none;
        border-bottom: 1px solid #E2E8F0;
        padding: 1.5rem;
    }

    .add-card-right {
        height: 50%;
    }
}

/* Mobile Add Card Modal */
@media (max-width: 768px) {
    .add-card-content {
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        flex-direction: column;
        margin: 0 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        box-shadow: none !important;
    }

    .add-card-mobile-view {
        display: block !important;
        padding: 0;
        overflow-y: auto;
        height: 100vh;
        background: white;
    }

    .add-card-detail-view {
        height: 100vh;
        overflow-y: auto;
        background: white;
    }

    .add-card-left,
    .add-card-right {
        display: none;
    }

    .add-card-list-item {
        background: white !important;
        border: 1px solid #E5E7EB !important;
        border-radius: 12px !important;
        padding: 1rem 1.25rem !important;
        margin-bottom: 0.75rem !important;
        cursor: pointer;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        transition: all 0.2s;
    }

    .add-card-list-item:hover {
        border-color: #6366F1 !important;
        background: #F9FAFB !important;
    }

    .search-container {
        position: relative;
        margin-bottom: 1.5rem;
    }

    .search-container input {
        width: 100%;
        padding: 0.875rem 1rem 0.875rem 3rem;
        border: 2px solid #6366F1;
        border-radius: 12px;
        font-size: 1rem;
        outline: none;
    }

    .search-container .material-icons {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: #6366F1;
        font-size: 20px;
    }

    .filter-pills {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .filter-pill {
        background: white;
        border: 1px solid #E5E7EB;
        padding: 0.5rem 1rem;
        border-radius: 20px;
        font-weight: 600;
        color: #1F2937;
        cursor: pointer;
        font-size: 0.875rem;
        transition: all 0.2s;
    }

    .filter-pill:hover {
        border-color: #6366F1;
        color: #6366F1;
    }

    .modal-close-mobile {
        display: flex !important;
    }

    /* Additional mobile styles for card detail view */
    .add-card-mobile-view {
        background: white;
    }

    .add-card-detail-view {
        background: white;
    }

    .add-card-list-item {
        padding: 1rem 1.25rem !important;
    }

    .search-container input {
        background: white;
    }

    /* Card visual in detail view */
    .add-card-detail-view .credit-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .add-card-detail-view .credit-card-chip {
        width: 50px;
        height: 35px;
        background: linear-gradient(135deg, #F4D03F, #C9A02C);
        border-radius: 6px;
        margin-bottom: 1rem;
    }

    .add-card-detail-view .credit-card-number {
        font-size: 1.25rem;
        letter-spacing: 0.1em;
        margin-bottom: 1rem;
        font-weight: 500;
    }

    .add-card-detail-view .credit-card-name {
        font-size: 0.9rem;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    /* Ensure card visual container doesn't have extra margins */
    .add-card-detail-view .card-visual-container {
        margin-bottom: 2rem;
        width: 100%;
    }
}