/**
 * Memoria - Credits Page Styles
 * Styles for credits purchase page (credits.html)
 */

body {
    background: #0B0A08;
    min-height: 100vh;
}

.credits-container {
    min-height: 100vh;
    padding-top: 100px;
    padding-bottom: 40px;
}

@media (min-width: 1024px) {
    .credits-container {
        padding-top: 120px;
    }
}

/* Balance Hero */
.balance-hero {
    background: linear-gradient(135deg, #2B2520 0%, #1A1612 100%);
    border: 2px solid #8B7355;
    border-radius: 12px;
    padding: clamp(20px, 4vw, 24px);
    margin-bottom: clamp(24px, 5vw, 32px);
    position: relative;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .balance-hero {
        padding: 20px 24px;
        margin-bottom: 24px;
    }
}

.balance-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(212, 165, 116, 0.15), transparent 70%);
    pointer-events: none;
}

.balance-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(139, 115, 85, 0.03) 2px, rgba(139, 115, 85, 0.03) 4px),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(139, 115, 85, 0.03) 2px, rgba(139, 115, 85, 0.03) 4px);
    pointer-events: none;
}

.balance-inner {
    position: relative;
    z-index: 2;
}

.balance-label {
    font-family: 'Commissioner', sans-serif;
    font-size: 0.875rem;
    color: #8B7355;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 12px;
    font-weight: 600;
}

.balance-display {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

@media (min-width: 1024px) {
    .balance-display {
        gap: 12px;
        margin-bottom: 12px;
    }
}

.balance-icon {
    width: clamp(56px, 12vw, 64px);
    height: clamp(56px, 12vw, 64px);
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.2), rgba(193, 154, 107, 0.1));
    border: 2px solid #8B7355;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #D4A574;
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .balance-icon {
        width: 48px;
        height: 48px;
    }

    .balance-icon i {
        width: 24px;
        height: 24px;
    }
}

.balance-amount {
    font-family: 'Unbounded', sans-serif;
    font-size: clamp(3rem, 10vw, 4rem);
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, #D4A574, #C19A6B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (min-width: 1024px) {
    .balance-amount {
        font-size: 2.5rem;
    }
}

.balance-hint {
    color: #B8A890;
    font-size: clamp(0.875rem, 2vw, 0.95rem);
    margin-bottom: 16px;
    padding: 12px 14px;
    background: rgba(212, 165, 116, 0.05);
    border-left: 3px solid #D4A574;
    border-radius: 4px;
}

@media (min-width: 1024px) {
    .balance-hint {
        font-size: 0.875rem;
        margin-bottom: 12px;
        padding: 10px 12px;
    }
}

.balance-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-card {
    background: rgba(212, 165, 116, 0.08);
    border: 1px solid #8B7355;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
}

@media (min-width: 1024px) {
    .stat-card {
        padding: 12px;
    }
}

.stat-value {
    font-family: 'Unbounded', sans-serif;
    font-size: clamp(1.75rem, 4vw, 2rem);
    font-weight: 700;
    color: #D4A574;
    margin-bottom: 4px;
}

@media (min-width: 1024px) {
    .stat-value {
        font-size: 1.25rem;
    }
}

.stat-label {
    font-size: 0.75rem;
    color: #8B7355;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

/* Credit Selector Section */
.section-title {
    font-family: 'Unbounded', sans-serif;
    font-size: clamp(1.5rem, 4vw, 1.75rem);
    color: #D4A574;
    margin-bottom: clamp(20px, 5vw, 24px);
    font-weight: 600;
}

@media (min-width: 1024px) {
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
}

.credit-selector {
    background: linear-gradient(135deg, #2B2520 0%, #1A1612 100%);
    border: 2px solid #8B7355;
    border-radius: 12px;
    padding: clamp(24px, 5vw, 32px);
    margin-bottom: clamp(32px, 5vw, 40px);
    position: relative;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .credit-selector {
        padding: 28px 32px;
        margin-bottom: 32px;
    }
}

.credit-selector::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 12px,
        rgba(212, 165, 116, 0.02) 12px,
        rgba(212, 165, 116, 0.02) 24px
    );
    pointer-events: none;
}

.selector-display {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(24px, 5vw, 32px);
    flex-wrap: wrap;
    gap: 20px;
}

@media (min-width: 1024px) {
    .selector-display {
        margin-bottom: 24px;
    }
}

.selected-amount {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.amount-value {
    font-family: 'Unbounded', sans-serif;
    font-size: clamp(3rem, 8vw, 4rem);
    font-weight: 700;
    background: linear-gradient(135deg, #D4A574, #C19A6B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

@media (min-width: 1024px) {
    .amount-value {
        font-size: 3.5rem;
    }
}

.amount-label {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: #B8A890;
}

@media (min-width: 1024px) {
    .amount-label {
        font-size: 1.1rem;
    }
}

.price-display {
    text-align: right;
}

.current-price {
    font-family: 'Unbounded', sans-serif;
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    color: #E5DDD3;
    line-height: 1.2;
}

@media (min-width: 1024px) {
    .current-price {
        font-size: 2.25rem;
    }
}

.original-price {
    font-size: 1rem;
    color: #8B7355;
    text-decoration: line-through;
    margin-top: 4px;
}

.discount-badge {
    display: inline-block;
    background: #C13E3E;
    color: #FFF;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 6px;
}

/* Slider */
.slider-container {
    position: relative;
    z-index: 2;
    margin-bottom: 24px;
}

@media (min-width: 1024px) {
    .slider-container {
        margin-bottom: 20px;
    }
}

.slider-tooltip {
    position: absolute;
    top: -50px;
    left: 0;
    transform: translateX(-50%) scale(0);
    background: linear-gradient(135deg, #D4A574, #C19A6B);
    color: #1A1612;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Unbounded', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.4);
}

.slider-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #C19A6B;
}

.slider-tooltip.active {
    transform: translateX(-50%) scale(1) !important;
    opacity: 1;
}

.credit-slider:active ~ .slider-tooltip {
    opacity: 1;
}

.credit-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(139, 115, 85, 0.3);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    position: relative;
    z-index: 3;
}

.credit-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right,
        rgba(212, 165, 116, 0.3) 0%,
        rgba(212, 165, 116, 0.6) 100%
    );
}

.credit-slider::-moz-range-track {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right,
        rgba(212, 165, 116, 0.3) 0%,
        rgba(212, 165, 116, 0.6) 100%
    );
}

.credit-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D4A574, #C19A6B);
    cursor: grab;
    box-shadow: 0 2px 12px rgba(212, 165, 116, 0.6),
                0 0 0 4px rgba(212, 165, 116, 0.1);
    transition: all 0.2s ease;
    border: 3px solid #1A1612;
}

.credit-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(212, 165, 116, 0.8),
                0 0 0 6px rgba(212, 165, 116, 0.15);
}

.credit-slider::-webkit-slider-thumb:active {
    transform: scale(1.05);
    cursor: grabbing;
    box-shadow: 0 2px 8px rgba(212, 165, 116, 0.5),
                0 0 0 8px rgba(212, 165, 116, 0.2);
}

.credit-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D4A574, #C19A6B);
    cursor: grab;
    border: 3px solid #1A1612;
    box-shadow: 0 2px 12px rgba(212, 165, 116, 0.6),
                0 0 0 4px rgba(212, 165, 116, 0.1);
    transition: all 0.2s ease;
}

.credit-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(212, 165, 116, 0.8),
                0 0 0 6px rgba(212, 165, 116, 0.15);
}

.credit-slider::-moz-range-thumb:active {
    transform: scale(1.05);
    cursor: grabbing;
    box-shadow: 0 2px 8px rgba(212, 165, 116, 0.5),
                0 0 0 8px rgba(212, 165, 116, 0.2);
}

.slider-marks {
    position: relative;
    width: 100%;
    height: 24px;
    margin-top: 8px;
}

.slider-mark {
    position: absolute;
    font-size: 0.75rem;
    color: #8B7355;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    padding: 4px 8px;
    border-radius: 4px;
    transform: translateX(-50%);
    top: 0;
}

.slider-mark:hover {
    color: #D4A574;
    background: rgba(212, 165, 116, 0.1);
}

.slider-mark.highlight {
    color: #D4A574;
    font-weight: 600;
    background: rgba(212, 165, 116, 0.15);
}

/* Quick Select */
.quick-select {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
}

@media (min-width: 1024px) {
    .quick-select {
        margin-bottom: 20px;
        gap: 10px;
    }
}

.quick-btn {
    flex: 1;
    min-width: 60px;
    padding: 10px 16px;
    background: rgba(212, 165, 116, 0.1);
    border: 1px solid #8B7355;
    border-radius: 6px;
    color: #B8A890;
    font-family: 'Unbounded', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (min-width: 1024px) {
    .quick-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
}

.quick-btn:hover {
    background: rgba(212, 165, 116, 0.15);
    border-color: #D4A574;
    color: #D4A574;
}

.quick-btn.active {
    background: linear-gradient(135deg, #D4A574, #C19A6B);
    border-color: #D4A574;
    color: #1A1612;
    box-shadow: 0 2px 8px rgba(212, 165, 116, 0.4);
}

/* Purchase Button */
.purchase-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #D4A574, #C19A6B);
    border: none;
    border-radius: 8px;
    color: #1A1612;
    font-family: 'Unbounded', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 16px rgba(212, 165, 116, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

@media (min-width: 1024px) {
    .purchase-btn {
        padding: 14px 20px;
        font-size: 0.9rem;
    }
}

.purchase-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212, 165, 116, 0.5);
}

.purchase-btn:active {
    transform: translateY(0);
}

/* Transactions */
.transactions-section {
    margin-top: clamp(48px, 10vw, 60px);
}

@media (min-width: 1024px) {
    .transactions-section {
        margin-top: 40px;
    }
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (min-width: 1024px) {
    .transactions-list {
        gap: 8px;
    }
}

.transaction-card {
    background: linear-gradient(135deg, #2B2520 0%, #1A1612 100%);
    border: 1px solid #8B7355;
    border-radius: 10px;
    padding: clamp(14px, 4vw, 16px);
    transition: all 0.3s ease;
}

@media (min-width: 1024px) {
    .transaction-card {
        padding: 14px 16px;
    }
}

.transaction-card:active {
    transform: scale(0.98);
}

@media (hover: hover) {
    .transaction-card:hover {
        border-color: #D4A574;
        transform: translateX(4px);
    }
}

.transaction-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

@media (min-width: 1024px) {
    .transaction-header {
        gap: 12px;
        margin-bottom: 8px;
    }
}

.transaction-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid;
}

@media (min-width: 1024px) {
    .transaction-icon {
        width: 40px;
        height: 40px;
    }
}

.transaction-icon.purchase {
    background: rgba(76, 175, 80, 0.15);
    border-color: rgba(76, 175, 80, 0.4);
    color: #4CAF50;
}

.transaction-icon.spend {
    background: rgba(244, 67, 54, 0.15);
    border-color: rgba(244, 67, 54, 0.4);
    color: #F44336;
}

.transaction-icon.promo {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.4);
    color: #FFC107;
}

.transaction-info {
    flex: 1;
    min-width: 0;
}

.transaction-description {
    color: #D4A574;
    font-weight: 600;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 1024px) {
    .transaction-description {
        font-size: 0.9rem;
    }
}

.transaction-description a {
    color: #D4A574;
    text-decoration: none;
    transition: color 0.2s;
}

.transaction-description a:hover {
    color: #E5C18A;
}

.transaction-date {
    font-size: 0.8rem;
    color: #8B7355;
}

.transaction-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid rgba(139, 115, 85, 0.3);
}

@media (min-width: 1024px) {
    .transaction-footer {
        padding-top: 8px;
    }
}

.transaction-amount {
    font-family: 'Unbounded', sans-serif;
    font-size: clamp(1.1rem, 3vw, 1.25rem);
    font-weight: 700;
}

@media (min-width: 1024px) {
    .transaction-amount {
        font-size: 1.1rem;
    }
}

.transaction-amount.positive {
    color: #4CAF50;
}

.transaction-amount.negative {
    color: #F44336;
}

.transaction-balance {
    font-size: 0.875rem;
    color: #B8A890;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: clamp(40px, 10vw, 80px) 20px;
    color: #8B7355;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 165, 116, 0.1);
    border: 2px solid #8B7355;
    border-radius: 50%;
    color: #D4A574;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(212, 165, 116, 0.2);
    border-top-color: #D4A574;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding: 16px 20px;
    background: rgba(212, 165, 116, 0.05);
    border: 1px solid #8B7355;
    border-radius: 10px;
    gap: 16px;
    flex-wrap: wrap;
}

@media (min-width: 1024px) {
    .pagination-container {
        margin-top: 20px;
        padding: 14px 18px;
    }
}

.pagination-info {
    font-size: 0.875rem;
    color: #B8A890;
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    gap: 10px;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(212, 165, 116, 0.1);
    border: 1px solid #8B7355;
    border-radius: 6px;
    color: #D4A574;
    font-family: 'Commissioner', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (min-width: 1024px) {
    .pagination-btn {
        padding: 7px 14px;
        font-size: 0.85rem;
    }
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(212, 165, 116, 0.15);
    border-color: #D4A574;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.2);
}

.pagination-btn:active:not(:disabled) {
    transform: translateY(0);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(139, 115, 85, 0.1);
    border-color: rgba(139, 115, 85, 0.3);
    color: #8B7355;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .credits-container {
        padding-top: 70px;
    }

    .balance-stats {
        gap: 12px;
    }

    .stat-card {
        padding: 14px;
    }

    .transaction-header {
        gap: 12px;
    }

    .transaction-icon {
        width: 44px;
        height: 44px;
    }

    .pagination-container {
        flex-direction: column;
        gap: 12px;
        padding: 14px 16px;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
    }

    .pagination-controls {
        width: 100%;
        justify-content: center;
    }

    .pagination-btn {
        flex: 1;
        justify-content: center;
        max-width: 150px;
    }
}
