/* ═══════════════════════════════════════════
   Coins Chest Store — Production Stylesheet
   Parchment & Gold Theme
   ═══════════════════════════════════════════ */

:root {
    --cc-dark: #1A0E0A;
    --cc-brown: #2C1810;
    --cc-warm: #5C4033;
    --cc-gold: #B8860B;
    --cc-gold-light: #D4A23A;
    --cc-gold-pale: #F2D06B;
    --cc-cream: #FFF8F0;
    --cc-bg: #F0E6D6;
    --cc-parchment: #E8D5B7;
    --cc-parchment-light: #F2E8D5;
    --cc-parchment-dark: #D4C4A8;
    --cc-wood: #8B5E3C;
    --cc-wood-dark: #5C3310;
    --cc-navy-accent: #2A3A5C;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--cc-parchment-light);
    color: var(--cc-brown);
}

/* ── Parchment Background Texture ── */
body {
    background-image: url('../images/parchment-bg.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    background-position: center center;
}

/* Layered parchment effect for main content */
.mud-main-content {
    background:
        linear-gradient(135deg, rgba(242, 232, 213, 0.85) 0%, rgba(232, 213, 183, 0.75) 50%, rgba(240, 230, 214, 0.85) 100%);
}

h1, h2, h3, h4, h5, h6 {
    font-family: Georgia, 'Times New Roman', serif;
}

h1:focus { outline: none; }

a { color: var(--cc-gold); text-decoration: none; }
a:hover { color: var(--cc-gold-light); }

/* ── Selection ── */
::selection {
    background: var(--cc-gold-pale);
    color: var(--cc-dark);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--cc-parchment-light); }
::-webkit-scrollbar-thumb {
    background: var(--cc-gold);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--cc-gold-light); }

/* ── Loading Screen ── */
.loading-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(212, 162, 58, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(184, 134, 11, 0.06) 0%, transparent 50%),
        linear-gradient(160deg, var(--cc-dark) 0%, #2A1A12 50%, var(--cc-wood-dark) 100%);
    min-height: 100vh;
}

.loading-logo {
    width: 200px;
    height: auto;
    margin-bottom: 24px;
    animation: loadPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 20px rgba(184, 134, 11, 0.4));
}

.loading-brand {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--cc-gold);
    letter-spacing: 0.04em;
    margin-bottom: 32px;
}

@keyframes loadPulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.03); opacity: 1; }
}

.loading-progress {
    display: block;
    width: 6rem;
    height: 6rem;
}

.loading-progress circle {
    fill: none;
    stroke: rgba(184, 134, 11, 0.2);
    stroke-width: 0.5rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--cc-gold);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    text-align: center;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--cc-gold-light);
    margin-top: 12px;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* ── Hero Sections ── */
.hero-section {
    position: relative;
    background-color: #CCB389;
    color: #3B2412;
    overflow: hidden;
    text-align: center;
    padding: 2rem 1rem 2.5rem;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #8B6914 30%, #B8860B 50%, #8B6914 70%, transparent 100%);
}

/* Logo with faded edges — blends into parchment background */
.hero-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.hero-logo {
    max-width: 620px;
    width: 90%;
    height: auto;
    -webkit-mask-image: radial-gradient(ellipse 85% 80% at 50% 50%, black 40%, transparent 72%);
    mask-image: radial-gradient(ellipse 85% 80% at 50% 50%, black 40%, transparent 72%);
}

.hero-text-block {
    position: relative;
    z-index: 1;
}

/* ── Gold Accent Utilities ── */
.gold-text { color: var(--cc-gold) !important; }
.gold-text-light { color: var(--cc-gold-light) !important; }

.gold-border-bottom {
    border-bottom: 2px solid var(--cc-gold);
    padding-bottom: 8px;
}

.gold-divider {
    height: 2px;
    background: linear-gradient(90deg, var(--cc-gold), var(--cc-gold-pale), var(--cc-gold));
    border: none;
    border-radius: 1px;
}

/* ── Parchment Card Style ── */
.parchment-card {
    background:
        linear-gradient(145deg, rgba(255, 252, 245, 0.95) 0%, rgba(242, 232, 213, 0.9) 100%) !important;
    border: 1px solid rgba(184, 134, 11, 0.2) !important;
    box-shadow: 0 2px 8px rgba(44, 24, 16, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

.parchment-card:hover {
    border-color: rgba(184, 134, 11, 0.4) !important;
    box-shadow: 0 8px 24px rgba(44, 24, 16, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

/* ── Coin Cards ── */
.coin-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border-radius: 12px !important;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(184, 134, 11, 0.2);
    background:
        linear-gradient(145deg, rgba(255, 252, 245, 0.97) 0%, rgba(242, 232, 213, 0.92) 100%) !important;
}

.coin-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(44, 24, 16, 0.15), 0 4px 8px rgba(184, 134, 11, 0.1) !important;
    border-color: rgba(184, 134, 11, 0.4);
}

.coin-card .mud-card-media {
    background-color: #F5F0EB;
}

.coin-card-price {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    color: var(--cc-gold) !important;
}

/* ── Trust Badges ── */
.trust-badge {
    text-align: center;
    padding: 2rem;
    transition: transform 0.2s ease;
}

.trust-badge:hover {
    transform: translateY(-2px);
}

.trust-badge-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cc-gold-pale), var(--cc-gold));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.25);
}

.trust-badge-icon .mud-icon-root {
    color: var(--cc-dark) !important;
}

/* ── Section Headers ── */
.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 2rem;
}

.section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--cc-gold), transparent);
}

/* ── Footer ── */
.site-footer {
    background:
        linear-gradient(180deg, rgba(26, 14, 10, 0.97) 0%, var(--cc-dark) 100%);
    color: rgba(255, 248, 240, 0.7);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
    border-top: 2px solid var(--cc-gold);
}

.site-footer a {
    color: var(--cc-gold-light);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--cc-gold-pale);
}

.footer-brand {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cc-gold);
}

.footer-logo {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(184, 134, 11, 0.3));
    border-radius: 6px;
}

.footer-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(184, 134, 11, 0.3), transparent);
    border: none;
    margin: 2rem 0 1.5rem;
}

/* ── Navbar Enhancements ── */
.nav-logo {
    height: 48px;
    width: auto;
    margin-right: 10px;
    filter: drop-shadow(0 2px 6px rgba(184, 134, 11, 0.35));
    border-radius: 4px;
}

.nav-brand {
    font-family: Georgia, 'Times New Roman', serif !important;
    font-weight: 700 !important;
    font-size: 1.35rem !important;
    color: var(--cc-gold) !important;
    letter-spacing: 0.02em;
}

/* ── Appbar with subtle gold underline ── */
.mud-appbar {
    border-bottom: 1px solid rgba(184, 134, 11, 0.3) !important;
}

/* ── Admin ── */
.admin-sidebar {
    background: var(--cc-dark) !important;
}

.admin-sidebar .mud-nav-link {
    color: rgba(255, 248, 240, 0.8) !important;
}

.admin-sidebar .mud-nav-link:hover,
.admin-sidebar .mud-nav-link.active {
    color: var(--cc-gold) !important;
    background: rgba(184, 134, 11, 0.1) !important;
}

.admin-nav-active {
    color: var(--cc-gold) !important;
    background: rgba(184, 134, 11, 0.12) !important;
    border-left: 3px solid var(--cc-gold) !important;
}

/* ── MudBlazor Surface Overrides for Parchment Feel ── */
.mud-paper {
    background:
        linear-gradient(145deg, rgba(255, 252, 245, 0.95) 0%, rgba(245, 238, 225, 0.92) 100%) !important;
}

.mud-table {
    background:
        linear-gradient(180deg, rgba(255, 252, 245, 0.97) 0%, rgba(245, 238, 225, 0.95) 100%) !important;
}

.mud-table .mud-table-head {
    background: rgba(44, 24, 16, 0.04) !important;
}

.mud-table .mud-table-row:hover {
    background: rgba(184, 134, 11, 0.06) !important;
}

/* Subtle gold borders on cards */
.mud-card {
    border: 1px solid rgba(184, 134, 11, 0.12);
    background:
        linear-gradient(145deg, rgba(255, 252, 245, 0.97) 0%, rgba(242, 232, 213, 0.93) 100%) !important;
}

/* ── Form Validation ── */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #2E7D32;
}

.invalid {
    outline: 1px solid #C62828;
}

.validation-message {
    color: #C62828;
}

/* ── Error UI ── */
#blazor-error-ui {
    color-scheme: light only;
    background: #FFF3E0;
    bottom: 0;
    box-shadow: 0 -2px 8px rgba(44, 24, 16, 0.15);
    display: none;
    left: 0;
    padding: 0.7rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 0.9rem;
    color: var(--cc-brown);
    border-top: 2px solid var(--cc-gold);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #C62828;
    padding: 1rem 1.5rem;
    color: white;
    border-radius: 8px;
    margin: 1rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ── Decorative Ornaments ── */
.ornament-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 2rem 0;
}

.ornament-divider::before,
.ornament-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cc-gold), transparent);
}

.ornament-divider .ornament-diamond {
    width: 8px;
    height: 8px;
    background: var(--cc-gold);
    transform: rotate(45deg);
    flex-shrink: 0;
}

/* ── Page title banner ── */
.page-title-banner {
    background:
        linear-gradient(160deg, var(--cc-dark) 0%, #2A1A12 40%, var(--cc-wood-dark) 100%);
    padding: 2rem 0;
    border-bottom: 2px solid var(--cc-gold);
    margin-bottom: 2rem;
}

/* ── Responsive ── */
/* NOTE: Mobile fixes live in css/mobile.css (a separate, freshly-named file) to
   sidestep IIS static-compression caching of app.css on the production server. */
@media (max-width: 600px) {
    .hero-logo {
        max-width: 340px;
    }
    .nav-brand {
        font-size: 1.1rem !important;
    }
    .nav-logo {
        height: 36px;
    }
    .footer-logo {
        height: 48px;
    }
    .loading-logo {
        width: 150px;
    }
}
