/* Custom Styles for Personality Detail */
.personality-hero {
    background: radial-gradient(circle at 20% 50%, #1e3a8a 0%, #0f172a 50%, #020617 100%);
    padding: 4rem 0 8rem 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.personality-hero::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.personality-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 3rem;
    transition: color 0.2s;
}

.personality-back-link:hover {
    color: white;
}

.personality-content-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 4rem;
    align-items: center;
}

.personality-avatar-large {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15), 0 0 60px rgba(59, 130, 246, 0.2), 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
}

.personality-avatar-large::after {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.personality-tagline-pill {
    display: inline-block;
    background: rgba(30, 58, 138, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

.personality-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    color: white;
}

.personality-description {
    font-size: 1.25rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    max-width: 700px;
}

.stats-cards-container {
    transform: translateY(-4rem);
    position: relative;
    z-index: 10;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.stats-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stats-card-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    color: #64748b;
}

.stats-card-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

.stats-card.dark {
    background: #0f172a;
    color: white;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.4);
}

.stats-card.dark .stats-card-label {
    color: rgba(255, 255, 255, 0.6);
}

/* Credit Card Visual Styles */
.credit-card {
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    /* Default */
    border-radius: 16px;
    padding: 1.5rem;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 2px solid transparent;
    transition: all 0.2s ease-in-out;
}

.credit-card-chip {
    width: 40px;
    height: 30px;
    background: linear-gradient(135deg, #e0e0e0 0%, #c0c0c0 100%);
    border-radius: 6px;
    margin-bottom: 1rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.credit-card-number {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    opacity: 0.9;
    margin-bottom: 1rem;
}

/* Card Specific Styles */
.card-amex-platinum {
    background: linear-gradient(135deg, #D7D7D7 0%, #A8A8A8 100%);
}

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

.card-chase {
    background: linear-gradient(135deg, #1E40AF 0%, #1E3A8A 100%);
}

.card-capital-one {
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
}

.card-citi {
    background: linear-gradient(135deg, #2563EB 0%, #1E40AF 100%);
}


/* Responsive Adjustments */
@media (max-width: 1024px) {
    .personality-content-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .personality-avatar-large {
        margin: 0 auto;
        width: 200px;
        height: 200px;
    }

    .personality-title {
        font-size: 3rem;
    }

    .personality-description {
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .personality-hero {
        padding-bottom: 6rem;
    }

    .personality-title {
        font-size: 2.5rem;
    }

    .personality-description {
        font-size: 1.1rem;
    }

    .stats-cards-container {
        transform: translateY(-2rem);
    }

    .stats-cards-container .grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
        padding-bottom: 0;
        margin: 0;
        padding-left: 0;
        padding-right: 0;
        overflow-x: visible;
    }

    .stats-card {
        min-width: 0;
        /* Allow shrinking */
        width: 100%;
        padding: 1.25rem 1rem;
        /* Compact padding */
        scroll-snap-align: none;
    }

    .stats-card-value {
        font-size: 1.5rem;
        /* Smaller font for mobile grid */
    }

    .stats-card-label {
        font-size: 0.65rem;
    }

    .card-option {
        width: 100% !important;
    }

    /* Carousel Styles */
    .slot-carousel {
        position: relative;
        display: flex;
        justify-content: center;
        /* Center the card */
        padding: 0 3rem;
        /* Make room for arrows */
    }

    .carousel-btn {
        display: flex;
        /* Show on mobile */
        position: absolute;
        top: 40%;
        /* Vertically centered relative to card visual approx */
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        background: white;
        border-radius: 50%;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 20;
        color: #1e293b;
        border: 1px solid #e2e8f0;
    }

    .carousel-btn.prev {
        left: 0;
    }

    .carousel-btn.next {
        right: 0;
    }

    /* Mobile Card Sizing for Arrows */
    .card-option {
        width: 100% !important;
        /* Full width of track */
        padding: 0 1rem;
        /* Internal padding if needed, or track padding */
    }

    /* Pagination Dots */
    .pagination-dots {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        margin-top: 1.5rem;
    }

    .pagination-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #e2e8f0;
        transition: all 0.2s;
    }

    .pagination-dot.active {
        background: #6366f1;
        /* Primary color */
        transform: scale(1.2);
    }
}

/* ========================================
   MODAL MOBILE OVERRIDES (Restoring Fixes)
   ======================================== */
@media (max-width: 768px) {

    /* Fix Modal Header Padding */
    .card-details-header {
        padding: 2rem 1.5rem 1rem 1.5rem !important;
    }

    /* Restore Mobile Close Button */
    .modal-close-desktop {
        display: none !important;
    }

    .modal-close-mobile {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: fixed;
        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;
        cursor: pointer;
    }

    /* Reset Big Box styles from style.css for cleaner list view */
    .expandable-row {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 1.25rem 0 !important;
        gap: 0 !important;
        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 !important;
    }
}

/* Hide carousel buttons AND dots on desktop */
@media (min-width: 769px) {

    .carousel-btn,
    .pagination-dots {
        display: none !important;
    }

    /* Desktop Grid Layout: Show all cards left-to-right */
    .card-option {
        display: block !important;
        /* Override inline display: none */
        width: 340px !important;
        margin-bottom: 2rem;
        /* Add spacing for wrapped rows */
        padding: 0;
    }

    .slot-carousel {
        padding: 0;
    }

    .carousel-track {
        flex-wrap: wrap !important;
        gap: 1.5rem !important;
        justify-content: flex-start !important;
    }