/* Sanctum Page - Basic Styling */

:root {
    --mystic-purple: #6B46C1;
    --mystic-gold: #FFD700;
    --cosmic-black: #0A0A0F;
    --glass-white: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
    color: #f5f5f5;
    min-height: 100vh;
    padding-top: 80px;
}

/* Container */
.sanctum-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    position: relative;
    z-index: 10;
}

/* Hero Section */
.sanctum-hero {
    text-align: center;
    margin-bottom: 60px;
}

.hero-symbol {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.sanctum-hero h1 {
    font-size: 2.5rem;
    color: var(--mystic-gold);
    margin: 0 0 15px 0;
    font-weight: 700;
    font-family: 'Cinzel', serif;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #b8a7d6;
    margin: 0;
}

/* 2-Column Grid Layout */
.sanctum-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.sanctum-column-left,
.sanctum-column-right {
    display: flex;
    flex-direction: column;
}

/* Mobile: Stack to single column */
@media (max-width: 768px) {
    .sanctum-grid {
        grid-template-columns: 1fr;
    }
}

/* Sanctum Cards */
.sanctum-card {
    background: var(--glass-white);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    transition: all 0.3s;
}

.sanctum-card:hover {
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: 0 10px 30px rgba(107, 70, 193, 0.2);
}

.sanctum-card h2 {
    color: #e4c4ff;
    font-size: 1.5rem;
    margin: 0 0 25px 0;
    font-weight: 600;
}

/* Profile Section */
.profile-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-item:last-child {
    border-bottom: none;
}

.profile-label {
    color: #9a8fb8;
    font-size: 0.95rem;
    font-weight: 500;
}

.profile-value {
    color: #e4c4ff;
    font-size: 1rem;
    font-weight: 600;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.verified {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-badge.unverified {
    background: rgba(255, 152, 0, 0.2);
    color: #ffb74d;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.status-badge.checking {
    background: rgba(255, 255, 255, 0.1);
    color: #b8a7d6;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Fortune Display */
.fortune-display-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 30px;
    background: rgba(255, 215, 0, 0.05);
    border-radius: 16px;
    border: 2px solid rgba(255, 215, 0, 0.2);
    margin-bottom: 25px;
}

.fortune-icon {
    font-size: 3rem;
}

.fortune-details {
    text-align: left;
}

.fortune-amount-large {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--mystic-gold);
    line-height: 1;
    margin-bottom: 5px;
}

.fortune-label-small {
    color: #9a8fb8;
    font-size: 0.9rem;
}

/* Buttons */
.seek-fortune-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--mystic-gold) 0%, #b8936d 100%);
    border: none;
    border-radius: 12px;
    color: var(--cosmic-black);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.seek-fortune-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}










/* Preference Sections */
.preference-section {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.preference-section:last-child {
    border-bottom: none;
}

.preference-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.preference-label {
    color: #e4c4ff;
    font-size: 1rem;
    font-weight: 600;
}

.preference-change-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #b8a7d6;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.preference-change-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.5);
    color: #FFD700;
}

.change-icon {
    font-size: 0.85rem;
}

.preference-hint {
    color: #7a6b9a;
    font-size: 0.85rem;
    margin: 0;
}

/* Preference Row Styles (used in HTML) */
.preference-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.preference-row:last-child {
    border-bottom: none;
}

.preference-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preference-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #b8a7d6;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.preference-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.5);
    color: #FFD700;
    transform: translateX(2px);
}













/* Currency Selector Styles */
.currency-selector-sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    max-width: 600px;
    width: calc(100% - 40px);
    background: rgba(26, 26, 46, 0.98);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    padding-bottom: 40px;
    z-index: 1000;
    transition: transform 0.3s ease;
    box-shadow: 0 -10px 40px rgba(107, 70, 193, 0.3), 0 0 0 1px rgba(255, 215, 0, 0.1);
}

.currency-selector-sheet.active {
    transform: translateX(-50%) translateY(0);
}

.currency-selector-header {
    text-align: center;
    margin-bottom: 20px;
}

.currency-selector-header h3 {
    margin: 0 0 5px 0;
    color: #f5f5f5;
    font-size: 1.2rem;
    font-weight: 600;
}

.currency-selector-header p {
    margin: 0;
    color: #a0a0a0;
    font-size: 0.9rem;
}

.currency-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
}

.currency-option {
    display: flex;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.currency-option:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.currency-option.selected {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
}

.currency-option input[type="radio"] {
    margin: 0;
    margin-right: 10px;
    accent-color: #FFD700;
}

.currency-symbol {
    font-size: 1.5rem;
    margin-right: 15px;
    width: 30px;
    text-align: center;
}

.currency-option-details {
    flex: 1;
}

.currency-option-primary {
    color: #f5f5f5;
    font-weight: 500;
    margin-bottom: 2px;
    font-size: 1rem;
}

.currency-option-label {
    color: #a0a0a0;
    font-size: 0.8rem;
}

.currency-sheet-close {
    width: 100%;
    padding: 15px;
    background: #FFD700;
    color: #1a1a2e;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.2s ease;
}

.currency-sheet-close:hover {
    background: #ffed4e;
    transform: translateY(-1px);
}

/* Overlay for backdrop */
.currency-selector-sheet::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.currency-selector-sheet.active::before {
    opacity: 1;
}

/* Scrollbar styling */
.currency-options::-webkit-scrollbar {
    width: 6px;
}

.currency-options::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.currency-options::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 3px;
}

.currency-options::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}


/* Reading History Styles */
.readings-history-container {
    margin-top: 1rem;
}

.reading-history-loading,
.reading-history-empty,
.reading-history-error {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-icon,
.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.start-reading-btn,
.retry-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    margin-top: 1rem;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Reading Item Styles */
.reading-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.reading-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.reading-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.reading-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.reading-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.reading-status.completed {
    background: var(--success-light);
    color: var(--success-dark);
}

.reading-status.in-progress {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.reading-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.reading-type {
    text-transform: capitalize;
}

.reading-progress {
    margin-bottom: 1rem;
}

.progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--mystic-purple), var(--mystic-gold));
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.reading-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.reading-link:hover {
    text-decoration: underline;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .currency-selector-sheet {
        width: calc(100% - 20px);
        padding: 15px;
        padding-bottom: 30px;
    }

    .currency-option {
        padding: 12px;
    }

    .currency-symbol {
        font-size: 1.3rem;
        margin-right: 12px;
    }
}

/* Background Particles */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    50% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0.8;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-200vh) translateX(-50px);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }
    
    .sanctum-container {
        padding: 30px 15px 60px;
    }
    
    .sanctum-hero h1 {
        font-size: 2rem;
    }
    
    .hero-symbol {
        font-size: 3rem;
    }
    
    .sanctum-card {
        padding: 20px;
    }
    
    .profile-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .fortune-display-large {
        flex-direction: column;
        text-align: center;
    }
    
    .fortune-details {
        text-align: center;
    }
    
    .fortune-amount-large {
        font-size: 2rem;
    }
}

/* ==================== PURCHASE CHRONICLE SHEET ==================== */

.view-chronicle-btn {
    background: linear-gradient(135deg, #4a148c 0%, #6a1b9a 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(106, 27, 154, 0.3);
}

.view-chronicle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(106, 27, 154, 0.4);
}

.purchase-chronicle-sheet {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.purchase-chronicle-sheet.active {
    opacity: 1;
    pointer-events: auto;
}

.chronicle-sheet-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.chronicle-sheet-content {
    position: relative;
    background: linear-gradient(180deg, rgba(26, 26, 46, 0.98) 0%, rgba(20, 20, 40, 0.98) 100%);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(179, 136, 255, 0.4);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(107, 70, 193, 0.4), 0 0 0 1px rgba(179, 136, 255, 0.2);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.purchase-chronicle-sheet.active .chronicle-sheet-content {
    transform: translateY(0);
}

.chronicle-sheet-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chronicle-sheet-header h3 {
    margin: 0;
    color: #f5f5f5;
    font-size: 1.3rem;
    font-weight: 600;
    background: linear-gradient(135deg, #b388ff 0%, #7c4dff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chronicle-sheet-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #f5f5f5;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.chronicle-sheet-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.chronicle-sheet-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.chronicle-loading {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

.chronicle-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.chronicle-empty-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.chronicle-empty p {
    margin: 8px 0;
    line-height: 1.6;
}

.chronicle-error {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.chronicle-error-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.chronicle-error button {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chronicle-error button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chronicle-purchases {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.purchase-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
}

.purchase-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(179, 136, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(179, 136, 255, 0.15);
}

.purchase-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.purchase-date {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 500;
}

.purchase-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.purchase-status.completed {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
}

.purchase-status.refunded {
    background: rgba(255, 152, 0, 0.2);
    color: #ffb74d;
}

.purchase-status.partial-refund {
    background: rgba(255, 193, 7, 0.2);
    color: #ffd54f;
}

.purchase-status.disputed {
    background: rgba(244, 67, 54, 0.2);
    color: #e57373;
}

.purchase-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.purchase-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.purchase-detail-row.secondary {
    opacity: 0.7;
    font-size: 0.9rem;
}

.purchase-detail-row.refund {
    color: #ffb74d;
}

.detail-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.detail-value {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

.detail-value.fortune-amount {
    color: #b388ff;
    font-weight: 600;
}

.purchase-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.transaction-id {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.transaction-id-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.transaction-id-value {
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #b388ff;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    flex: 1;
    min-width: 150px;
}

.copy-id-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.copy-id-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.view-receipt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(179, 136, 255, 0.2);
    border: 1px solid rgba(179, 136, 255, 0.3);
    color: #b388ff;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.view-receipt-btn:hover {
    background: rgba(179, 136, 255, 0.3);
    border-color: rgba(179, 136, 255, 0.5);
    transform: translateX(2px);
}

.purchase-note {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(179, 136, 255, 0.1);
    border-left: 3px solid rgba(179, 136, 255, 0.5);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chronicle-sheet-content {
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
    }

    .chronicle-sheet-header {
        padding: 16px 20px;
    }

    .chronicle-sheet-header h3 {
        font-size: 1.15rem;
    }

    .chronicle-sheet-body {
        padding: 16px 20px;
    }

    .purchase-card {
        padding: 14px;
    }

    .purchase-date {
        font-size: 0.9rem;
    }

    .transaction-id {
        flex-direction: column;
        align-items: flex-start;
    }

    .transaction-id-value {
        width: 100%;
    }
}