:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-soft: rgba(255, 255, 255, 0.85);
    --surface-muted: #eef1fb;
    --primary: #5b6bf7;
    --secondary: #0bc5ea;
    --accent: #f8b74a;
    --text: #1f2346;
    --muted: #6e7399;
    --positive: #1ea97c;
    --negative: #f15b74;
    --border: rgba(31, 35, 70, 0.14);
    --shadow: 0 22px 45px rgba(31, 35, 70, 0.12);
    --radius: 20px;
    font-size: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Vazirmatn', sans-serif;
    background: linear-gradient(180deg, #f9fbff 0%, #eff3ff 40%, #f7f9ff 100%);
    color: var(--text);
    line-height: 1.7;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(1120px, 92vw);
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface);
    border-bottom: 1px solid rgba(31, 35, 70, 0.06);
    box-shadow: 0 10px 30px rgba(31, 35, 70, 0.08);
}

.topbar__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 0;
    gap: 1rem;
}

.brand {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary);
}

.topbar__links {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    font-size: 0.95rem;
    color: var(--muted);
}

.topbar__links a:hover {
    color: var(--primary);
}

.topbar__cta {
    padding: 0.55rem 1.4rem;
    border-radius: 999px;
    background: rgba(91, 107, 247, 0.12);
    color: var(--primary);
    border: 1px solid rgba(91, 107, 247, 0.2);
    transition: background 0.2s ease;
}

.topbar__cta:hover {
    background: rgba(91, 107, 247, 0.2);
}

.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(91, 107, 247, 0.2) 0%, rgba(11, 197, 234, 0.14) 45%, rgba(255, 255, 255, 0.9) 100%);
    padding: 3.5rem 0 1rem;
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.92) 60%);
}

.hero__content {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2.5rem;
    align-items: stretch;
}

.hero__price-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.hero__price-head {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hero__price-head img {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    object-fit: cover;
}

.hero__price-label {
    font-size: 0.85rem;
    color: var(--muted);
}

.hero__price-symbol {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: var(--primary);
    margin-top: 0.2rem;
    font-weight: 600;
}

.hero__price-value {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 700;
}

.hero__price-sub {
    font-size: 0.95rem;
    color: var(--muted);
}

.hero__price-change {
    font-weight: 600;
    font-size: 1rem;
}

.hero__price-updated {
    color: var(--muted);
    font-size: 0.8rem;
}

.hero__intro {
    align-self: center;
}

.hero__intro h1 {
    font-size: clamp(2.1rem, 5vw, 3rem);
    margin: 0.7rem 0;
}

.hero__intro p {
    color: var(--muted);
    max-width: 32rem;
}

.hero__card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.8rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    background: rgba(91, 107, 247, 0.12);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
}

.hero__actions {
    margin-top: 1.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.btn {
    padding: 0.85rem 1.8rem;
    border-radius: 999px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn--primary {
    background: linear-gradient(120deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 16px 30px rgba(91, 107, 247, 0.25);
}

.btn--primary:hover {
    transform: translateY(-2px);
}

.btn--ghost {
    background: rgba(91, 107, 247, 0.08);
    border: 1px solid rgba(91, 107, 247, 0.18);
    color: var(--primary);
}

.section {
    padding: 3.8rem 0;
    position: relative;
}

main .section:first-of-type {
    padding-top: 2.8rem;
}

.section--alt {
    background: linear-gradient(180deg, rgba(239, 243, 255, 0.92), rgba(255, 255, 255, 0.95));
}

.section--light {
    background: var(--surface);
}

.section__header {
    margin-bottom: 1.8rem;
}

.section__header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.section__header p {
    color: var(--muted);
    max-width: 36rem;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.table th,
.table td {
    padding: 1rem 1.2rem;
    text-align: right;
    border-bottom: 1px solid rgba(31, 35, 70, 0.08);
    font-size: 0.95rem;
}

.table thead th {
    font-weight: 700;
    background: var(--surface-muted);
}

.table tbody tr:hover {
    background: rgba(91, 107, 247, 0.05);
}

.coin-name {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.coin__symbol {
    font-size: 0.85rem;
    color: var(--muted);
}

.coin__label {
    font-weight: 600;
}

.change {
    font-weight: 600;
}

.positive {
    color: var(--positive);
}

.negative {
    color: var(--negative);
}

.overview {
    display: grid;
    gap: 1rem;
}

.overview__label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.2rem;
}

.explore {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.explore__controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

#coin-search {
    flex: 1;
    min-width: 240px;
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 1rem;
}

#coin-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91, 107, 247, 0.18);
}

.coin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.coin-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.4rem;
    border: 1px solid var(--border);
    box-shadow: 0 12px 30px rgba(31, 35, 70, 0.08);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.coin-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 38px rgba(31, 35, 70, 0.14);
}

.coin-card__header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.coin-card__header img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--surface-muted);
}

.coin-card__price {
    font-size: 1.2rem;
    font-weight: 700;
}

.coin-card__meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--muted);
}

.loader {
    width: 100%;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
}

.muted {
    color: var(--muted);
}

.empty-state {
    padding: 1.4rem;
    border-radius: var(--radius);
    background: rgba(91, 107, 247, 0.08);
    color: var(--primary);
    text-align: center;
}

.chart-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.4rem;
}

.feature-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.8rem;
    border: 1px solid var(--border);
    box-shadow: 0 12px 28px rgba(31, 35, 70, 0.08);
}

.movers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
}

.mover-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mover-card img {
    width: 42px;
    height: 42px;
    border-radius: 14px;
}

.mover-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 30px rgba(31, 35, 70, 0.12);
}

.badge--ghost {
    background: rgba(91, 107, 247, 0.1);
    color: var(--primary);
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
}

.faq details {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem 1.3rem;
    border: 1px solid var(--border);
    margin-bottom: 0.8rem;
}

.faq summary {
    cursor: pointer;
    font-weight: 600;
}

.section--seo {
    background: #f8f9fb;
    color: #1f2937;
}

.section--seo .seo {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.seo__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.75rem;
}

.seo__card {
    background: #fff;
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 24px 70px -30px rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(148, 163, 184, 0.2);
    line-height: 1.9;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.seo__card:hover {
    transform: translateY(-6px);
    box-shadow: 0 32px 80px -28px rgba(15, 23, 42, 0.3);
}

.seo__card h3 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: 700;
}

.seo__keywords ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem 1.5rem;
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 0;
}

.seo__keywords li {
    position: relative;
    padding-right: 1.25rem;
    font-weight: 600;
    color: #0f172a;
}

.seo__keywords li::before {
    content: "•";
    position: absolute;
    right: 0;
    color: #6366f1;
    font-size: 1.4rem;
    line-height: 1;
    top: 0.1rem;
}

.seo__cta {
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
    color: #111827;
    margin: 0 auto;
    max-width: 860px;
}

.footer {
    background: #10153a;
    color: #f0f2ff;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer__content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.footer__tags span {
    display: inline-block;
    margin: 0.2rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
}

.footer__links ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.6rem;
}

.footer__links a:hover {
    color: var(--accent);
}

.footer__bottom {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.8;
}

.form {
    display: grid;
    gap: 0.8rem;
}

.form input,
.form textarea,
.form button {
    font-family: inherit;
}

.form input,
.form textarea {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.form input:focus,
.form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91, 107, 247, 0.18);
}

.form button {
    justify-self: start;
}

.footer .form input,
.footer .form textarea {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
}

.footer .form input:focus,
.footer .form textarea:focus {
    border-color: var(--accent);
    box-shadow: none;
}

.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-top: 1rem;
}

.alert--success {
    background: rgba(30, 169, 124, 0.12);
    color: var(--positive);
}

.alert--error {
    background: rgba(241, 91, 116, 0.12);
    color: var(--negative);
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(16, 21, 58, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 100;
}

.modal[hidden] {
    display: none;
}

.modal__dialog {
    background: var(--surface);
    border-radius: calc(var(--radius) + 4px);
    width: min(640px, 92vw);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.modal__close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(91, 107, 247, 0.12);
    color: var(--primary);
    font-size: 1.4rem;
    cursor: pointer;
}

.modal__body {
    padding: 2.4rem;
    display: grid;
    gap: 1.6rem;
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.4rem;
}

.modal__title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal__title img {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: var(--surface-muted);
}

.modal__price strong {
    font-size: 1.3rem;
}

.modal__price small {
    display: block;
    color: var(--muted);
    margin-top: 0.3rem;
}

.modal__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.modal__grid div {
    background: var(--surface-muted);
    border-radius: var(--radius);
    padding: 1rem;
    font-size: 0.9rem;
}

.modal__grid span {
    display: block;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.modal__description {
    line-height: 1.8;
    color: var(--muted);
}

.modal__link {
    justify-self: start;
    color: var(--primary);
    font-weight: 600;
}

body.modal-open {
    overflow: hidden;
}

.admin-dashboard,
.admin-login {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2.4rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.admin-dashboard h2,
.admin-login h2 {
    margin-top: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.2rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--surface-muted);
    border-radius: var(--radius);
    padding: 1.2rem;
}

.stat-card__label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.admin-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.panel {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.6rem;
    border: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(31, 35, 70, 0.08);
}

.list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.6rem;
}

.list li {
    display: grid;
    gap: 0.2rem;
    background: var(--surface-muted);
    border-radius: 14px;
    padding: 0.9rem 1rem;
}

.hint {
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 0.8rem;
}

@media (max-width: 768px) {
    .topbar__links {
        display: none;
    }
    .hero {
        padding-top: 2.6rem;
        padding-bottom: 1.2rem;
    }
    .hero__content {
        grid-template-columns: 1fr;
    }
    .hero__price-card {
        order: -1;
    }
    .section {
        padding: 3rem 0;
    }
    main .section:first-of-type {
        padding-top: 2.2rem;
    }
    .explore__controls {
        flex-direction: column;
        align-items: stretch;
    }
    #coin-search {
        min-width: 100%;
    }
    .coin-card {
        padding: 1.2rem;
    }
    .coin-card__meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }
    .seo__grid {
        grid-template-columns: 1fr;
    }
    .seo__keywords ul {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 540px) {
    .btn {
        width: 100%;
        text-align: center;
    }
    .modal__body {
        padding: 1.8rem;
    }
    .modal__close {
        left: 0.6rem;
        top: 0.6rem;
    }
}
