/* 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);
    width: 100%;
    aspect-ratio: 1.586;
    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;
    }

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

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

    /* Personality Slot Container Mobile */
    .personality-slot-container {
        padding: 2rem 1rem !important;
    }

    /* Reduce vertical spacing in slot info */
    .personality-slot-container>div:first-child {
        margin-bottom: 1.5rem !important;
        text-align: center;
    }

    .personality-slot-container h3 {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem !important;
        font-weight: 700 !important;
    }

    .personality-slot-container p {
        font-size: 1rem !important;
        line-height: 1.5 !important;
        margin-bottom: 0 !important;
        color: #64748b !important;
    }

    /* Carousel Styles */
    .slot-carousel {
        position: relative;
        display: flex;
        justify-content: center;
        padding: 0;
        flex-direction: column;
        overflow: visible;
        /* Allow shadow overflow */
    }


    .carousel-btn {
        display: flex;
        width: 40px;
        height: 40px;
        background: white;
        border-radius: 50%;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #64748b;
        border: 1px solid #e2e8f0;
        transition: all 0.2s;
        user-select: none;
    }

    .carousel-btn:hover {
        background: #f8fafc;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        color: #3b82f6;
    }

    .carousel-btn:active {
        transform: scale(0.95);
    }

    /* Hide desktop-only controls if any remain or ensure they show on mobile */
    .slot-controls {
        display: flex !important;
        /* Force show on mobile */
    }

    /* Metadata below card */
    .card-option>div:last-child {
        margin-top: 0.5rem !important;
        /* Reduced from 1rem */
    }

    /* Adjust Card Height for Mobile (Maintain Aspect Ratio) */
    .credit-card {
        height: auto !important;
        aspect-ratio: 1.586;
        /* Standard Credit Card Ratio */
        padding: 1rem !important;
    }

    .credit-card-number {
        font-size: 0.9rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* Prev/Next positioning removed */

    /* Mobile Card Sizing - Add blue border container */
    .card-option {
        width: 100% !important;
        max-width: 440px;
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 0.25rem;
        background: white;
        border: 3px solid transparent;
        border-radius: 32px;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
        position: relative;
        /* Context for info button */
        transition: border-color 0.2s ease;
    }

    .card-option.selected {
        border-color: #3b82f6 !important;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
    }

    .card-info-btn {
        top: 1rem !important;
        /* 0.25rem padding + 0.75rem offset */
        left: 1rem !important;
        /* 0.25rem padding + 0.75rem offset */
    }

    .carousel-track {
        padding: 0 !important;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center !important;
        width: 100% !important;
    }

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

    .pagination-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #cbd5e1;
        transition: all 0.3s;
        cursor: pointer;
    }

    .pagination-dot.active {
        background: #6366f1;
        width: 24px;
        border-radius: 5px;
    }
}

/* ========================================
   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;
    }
}

/* Desktop Layout */
@media (min-width: 769px) {

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

    /* Desktop: Horizontal scroll with fixed width (4 cards viewable) */
    .card-option {
        display: block !important;
        /* Formula: (100% - (3 * 1.5rem gap)) / 4 = 25% - 1.125rem */
        flex: 0 0 calc(25% - 1.125rem) !important;
        width: calc(25% - 1.125rem) !important;
        margin-bottom: 0;
        padding: 1.25rem;
        background: white;
        border: 2px solid transparent;
        border-radius: 20px;
        transition: all 0.3s;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        position: relative;
        min-height: 100%;
        scroll-snap-align: start;
    }

    /* Selected card gets blue border */
    .card-option.selected {
        border-color: #3b82f6 !important;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    }

    .slot-carousel {
        padding: 0;
        width: 100%;
        overflow: visible;
        /* Allow shadow/transform overflow */
    }

    .carousel-track {
        display: flex !important;
        gap: 1.5rem !important;
        width: 100%;
        padding-bottom: 1.5rem;
        /* Space for shadow/scrollbar */
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        align-items: stretch;
        justify-content: center !important;
    }

    .carousel-track.align-start {
        justify-content: flex-start !important;
    }

    .personality-slot-container {
        padding: 2rem !important;
    }
}

/* Info Button Styling */
.card-info-btn {
    position: absolute;
    top: 2.25rem;
    /* 1.25rem padding + 1rem offset */
    left: 2.25rem;
    /* 1.25rem padding + 1rem offset */
    z-index: 20;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-info-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.card-info-btn .material-icons {
    font-size: 18px;
    color: #64748B;
    /* Slate 500 */
}

/* Ensure darker background for info button on white/light cards if needed, 
   but most cards have images/gradients. Adding a text-shadow or using mixed-blend-mode 
   might be overkill. The semi-transparent white bg is usually safe. */
/* REFACTORED INLINE STYLES */

.personality-detail-container {
    padding: 0;
    background: #F8FAFC;
}

.personality-back-icon {
    font-size: 16px;
}

.personality-avatar-img {
    width: 60%;
    height: 60%;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
}

.stats-icon-base {
    font-size: 16px;
}

.stats-icon-warning {
    color: #ef4444;
}

.stats-value-base {
    color: #1e293b;
}

.stats-icon-verified {
    color: #3b82f6;
}

.stats-icon-trending {
    color: #8b5cf6;
}

.stats-icon-success {
    color: #10b981;
}

.stats-value-success {
    color: #10b981;
}

.loadout-section {
    padding-bottom: 6rem;
}

.loadout-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.loadout-icon {
    color: #2563eb;
    font-size: 28px;
}

.loadout-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}

.loadout-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: minmax(0, 1fr);
}

.slot-container {
    background: white;
    border-radius: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.slot-info-wrapper {
    margin-bottom: 2rem;
    position: relative;
}

.slot-nav-btn {
    position: absolute;
    top: 0;
    z-index: 10;
}

.slot-nav-prev {
    left: 0;
}

.slot-nav-next {
    right: 0;
}

.slot-text-content {
    text-align: center;
    padding: 0 3.5rem;
}

.slot-badge {
    display: inline-block;
    background: #f1f5f9;
    color: #64748b;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.slot-title-text {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.slot-description-text {
    color: #64748b;
    line-height: 1.6;
}

.slot-card-hidden {
    display: none;
}

.card-visual-wrapper {
    position: relative;
    padding: 0 !important;
    background: none;
    border: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    width: 100% !important;
    margin: 0 auto !important;
}

.card-img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.selection-indicator-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.selection-indicator-internal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.2s;
}

.status-icon-active {
    font-size: 18px;
    color: #3b82f6;
}

.status-icon-light {
    font-size: 18px;
    color: white;
}

.card-visual-header {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    margin-bottom: 1rem;
    height: 24px;
}

.card-visual-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.strategy-label {
    font-size: 0.65rem;
    font-weight: 700;
    opacity: 0.8;
    margin-bottom: 0.25rem;
    letter-spacing: 0.1em;
}

.logo-circle-placeholder {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

.card-meta-container {
    text-align: center;
    margin-top: 1rem;
    padding: 0 0.5rem;
}

.card-name-meta {
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.card-details-meta {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.text-slate-400 {
    color: #94a3b8;
}

.meta-separator {
    margin: 0 0.5rem;
    color: #cbd5e1;
}

.text-blue-500 {
    color: #3b82f6;
}

.empty-loadout-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    border: 2px dashed #e5e7eb;
}

.empty-loadout-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-loadout-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-loadout-text {
    color: #6b7280;
}

.rules-section {
    padding: 0 0 4rem 0;
}

.rules-container {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.rules-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #111827;
}

.rules-grid {
    display: grid;
    gap: 1.5rem;
}

.rule-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    align-items: start;
}

.rule-number {
    width: 32px;
    height: 32px;
    background: #111827;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.rule-content h3 {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #111827;
}

.rule-content p {
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}