/* SecondPage styles — loaded as global CSS to bypass Blazor CSS isolation */

* {
    box-sizing: border-box;
}

.detail-wrapper {
    font-family: 'Vazirmatn', sans-serif;
    background: transparent;
    color: #f8fafc;
    min-height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 1.5rem 1rem;
}

.detail-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.glass-effect {
    background: rgba(30, 41, 59, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

/* Flash Animations */
.flash-green {
    animation: spFlashGreen 1.2s ease-out forwards;
}

.flash-red {
    animation: spFlashRed 1.2s ease-out forwards;
}

@keyframes spFlashGreen {
    0% {
        background-color: rgba(34, 197, 94, 0.4);
        border-color: rgba(34, 197, 94, 0.8);
        box-shadow: 0 0 40px rgba(34, 197, 94, 0.3);
        transform: scale(1.02);
    }
    100% {
        background-color: rgba(30, 41, 59, 0.35);
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        transform: scale(1);
    }
}

@keyframes spFlashRed {
    0% {
        background-color: rgba(239, 68, 68, 0.4);
        border-color: rgba(239, 68, 68, 0.8);
        box-shadow: 0 0 40px rgba(239, 68, 68, 0.3);
        transform: scale(1.02);
    }
    100% {
        background-color: rgba(30, 41, 59, 0.35);
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        transform: scale(1);
    }
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e2e8f0;
}

.back-btn {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
    text-decoration: none;
}

.back-btn:hover {
    background: rgba(30, 41, 59, 0.8);
    color: #fff;
}

.identity-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    padding: 4px;
    background: rgba(255,255,255,0.05);
    margin-bottom: 1rem;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.1);
}

.currency-flag {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.currency-name-fa {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.currency-code-en {
    font-size: 0.9rem;
    color: #64748b;
    font-family: monospace;
}

.price-hero-section {
    text-align: center;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,0.03);
}

.price-label {
    font-size: 0.8rem;
    color: #94a3b8;
    display: block;
    margin-bottom: 0.5rem;
}

.price-value-wrapper {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.price-amount {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.price-unit {
    font-size: 1rem;
    color: #64748b;
}

.trend-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,0.05);
    padding: 0.3rem 0.8rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-positive,
.trend-badge.up {
    color: #4ade80;
}

.badge-negative,
.trend-badge.down {
    color: #f87171;
}

.badge-neutral,
.trend-badge.neutral {
    color: #94a3b8;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    color: #64748b;
    display: block;
    margin-bottom: 0.3rem;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    font-family: ui-monospace, monospace;
}

.converter-section {
    background: rgba(56, 189, 248, 0.05);
    border: 1px dashed rgba(56, 189, 248, 0.2);
    border-radius: 16px;
    padding: 1.2rem;
}

.converter-title {
    font-size: 0.9rem;
    color: #38bdf8;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 700;
}

.converter-input-group {
    position: relative;
    margin-bottom: 0.8rem;
}

.converter-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.8rem;
    padding-left: 3rem;
    border-radius: 10px;
    color: #fff;
    font-size: 1.1rem;
    text-align: center;
    font-family: 'Vazirmatn', sans-serif;
}

.converter-input:focus {
    outline: none;
    border-color: #38bdf8;
}

.converter-symbol {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 0.8rem;
}

.converter-result {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.converter-result small {
    font-size: 0.7rem;
    color: #64748b;
    margin-right: 4px;
}

.fade-in {
    animation: spFadeIn 0.5s ease-out;
}

.fade-in-up {
    animation: spFadeInUp 0.6s ease-out;
}

@keyframes spFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes spFadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.loading-state,
.error-state {
    text-align: center;
    margin-top: 4rem;
    color: #94a3b8;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: spSpin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.back-btn-primary {
    display: inline-block;
    background: #38bdf8;
    color: #0f172a;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    margin-top: 1rem;
    cursor: pointer;
    text-decoration: none;
}

.LinkTo {
    width: 49%;
    height: 80px;
    line-height: 60px;
    text-align: center;
    margin-top: 10px;
    margin-right: 5px;
    display: inline-flex;
    padding: 10px;
    border-radius: 10px;
    background-color: rgba(30, 41, 59, 0.35);
}

@media (max-width: 400px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Currency news section on SecondPage ─────────── */
.sp-news-section {
    margin-top: 1.5rem;
}

.sp-news-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
}

.sp-news-accent {
    display: block;
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, #38bdf8, #6366f1);
    border-radius: 4px;
    flex-shrink: 0;
}

.sp-news-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0;
}

.sp-news-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sp-news-item {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.sp-news-item:hover {
    background: rgba(56, 189, 248, 0.06);
    border-color: rgba(56, 189, 248, 0.2);
}

.sp-news-thumb {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.sp-news-thumb-ph {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.sp-news-body {
    flex: 1;
    min-width: 0;
}

.sp-news-item-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-news-excerpt {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0 0 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sp-news-date {
    font-size: 0.68rem;
    color: #475569;
}
