/* ================================
   RESET & GLOBAL
=================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

/* Default body (other pages) */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #020617;
    color: #e5e7eb;
    direction: rtl;
}

/* Special homepage style */
body.kd-body {
    font-family: "Noto Sans Arabic", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #131b3f 0, #050814 45%, #02030a 100%);
    color: #f4f5ff;
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
}

/* ================================
   LOGO
=================================== */

.kd-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-text {
    font-weight: 700;
    letter-spacing: 0.12em;
    font-size: 18px;
    color: #f7d673; /* gold tone for KD */
}

/* Circular gradient logo used in market layout header etc. */
.logo-mark {
    width: 14px;
    height: 34px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #facc15, #ef4444, #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #020617;
}

/* If you put an <img> inside .logo-mark */
.logo-mark img {
    height: 100%;
    width: 100%;
    display: block;
}

/* ================================
   BUTTONS
=================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.85rem;
    cursor: pointer;
    background: transparent;
    color: #e5e7eb;
    transition: background 0.2s ease, color 0.2s ease,
                border-color 0.2s ease, transform 0.1s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Green primary (market pages etc.) */
.btn-primary {
    background: #22c55e;
    border-color: #22c55e;
    color: #020617;
}

.btn-primary:hover {
    background: #16a34a;
    border-color: #16a34a;
}

/* Dark outline button */
.btn-outline {
    border-color: #334155;
    background: #020617;
    color: #e5e7eb;
}

.btn-outline:hover {
    background: #0f172a;
}

/* Soft dark button */
.btn-soft {
    background: #0f172a;
    border-color: #1e293b;
}

/* Small size */
.btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
}

/* Gradient buttons for KD homepage */
.btn.primary {
    background: linear-gradient(90deg, #315bff, #01c2ff);
    color: #fff;
    box-shadow: 0 0 18px rgba(1, 194, 255, 0.45);
}

.btn.ghost {
    background: transparent;
    color: #e5e7ff;
    border-color: rgba(156, 163, 255, 0.6);
}

/* ================================
   LAYOUT
=================================== */

.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.kd-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 16px 40px;
}

/* ================================
   HEADERS / NAVBARS
=================================== */

/* KD homepage header */

.kd-social {
    display: flex;
    gap: 8px;
    align-items: center;
}

.kd-social a {
    display: inline-flex;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #020617;
    border: 1px solid #1e293b;
    padding: 4px;
    transition: 0.2s;
}

.kd-social a:hover {
    border-color: #22c55e;
    background: #0f172a;
    transform: translateY(-2px);
}

.kd-social img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}


.kd-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(3, 7, 23, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(93, 151, 255, 0.15);
}

.kd-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.kd-nav {
    display: flex;
    gap: 18px;
    margin-inline-start: 24px;
    flex: 1;
}

.kd-nav a {
    text-decoration: none;
    font-size: 14px;
    color: #c7d2ff;
    padding: 6px 0;
    position: relative;
}

.kd-nav a::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #5b9bff, #f7d673);
    transition: width 0.2s ease-out;
}

.kd-nav a:hover::after {
    width: 100%;
}

.kd-auth {
    display: flex;
    gap: 8px;
}

/* Site-wide header for market pages */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #1e293b;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.65rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
}

.brand-title {
    font-weight: 700;
    font-size: 1rem;
}

.brand-sub {
    font-size: 0.7rem;
    color: #9ca3af;
}

.search-box {
    flex: 1;
    max-width: 320px;
}

.search-box input {
    width: 100%;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #1f2937;
    background: #020617;
    color: #e5e7eb;
    font-size: 0.8rem;
}

.search-box input::placeholder {
    color: #6b7280;
}

.main-nav {
    display: flex;
    gap: 0.9rem;
    font-size: 0.85rem;
}

.main-nav a {
    padding: 0.2rem 0.2rem;
    color: #cbd5f5;
}

.main-nav a.active {
    color: #22c55e;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.social-links {
    display: flex;
    gap: 0.3rem;
    font-size: 1rem;
}

.social-links a {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #020617;
    border: 1px solid #1e293b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.social-links a:hover {
    background: #0f172a;
    border-color: #22c55e;
    color: #22c55e;
}

.auth-buttons {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.welcome {
    font-size: 0.8rem;
    color: #cbd5f5;
}

/* ================================
   HERO SECTION  (KD VERSION)
=================================== */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1.4fr);
    gap: 32px;
    align-items: center;
    margin-top: 1.75rem;
    margin-bottom: 40px;
}

.hero-text h1,
.hero h1 {
    font-size: 30px;
    margin: 0 0 12px;
}

.hero-text p,
.hero p {
    margin: 0 0 18px;
    color: #d0d6ff;
    line-height: 1.7;
    font-size: 14px;
}

.hero-actions {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
    margin-bottom: 16px;
}

.hero-meta,
.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 12px;
    color: #a5b4ff;
}

.badge-soft {
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: #0f172a;
    color: #a5f3fc;
    font-size: 0.7rem;
}

.hero-panel,
.hero-side {
    display: flex;
    justify-content: center;
    flex-direction: column;
    gap: 0.75rem;
}

/* KD small stats card */
.panel-card,
.info-card {
    background: radial-gradient(circle at top, #172555, #050814);
    border-radius: 18px;
    padding: 18px 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(93, 151, 255, 0.3);
}

.info-card {
    background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.15), transparent);
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    border-color: #1e293b;
    box-shadow: none;
}

.panel-card h2,
.info-card h3 {
    font-size: 16px;
    margin: 0 0 12px;
}

.info-card p {
    margin: 0;
    font-size: 0.8rem;
    color: #cbd5f5;
}

/* Market short preview in hero */
.market-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.7fr;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(148, 163, 255, 0.3);
}

.market-row:last-child {
    border-bottom: none;
}

.price {
    text-align: center;
}

.change {
    text-align: left;
}

.change.up,
.up {
    color: #4ade80;
}

.change.down,
.down {
    color: #fb7185;
}

.change.flat {
    color: #e5e7eb;
}

.panel-link {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    text-decoration: none;
    color: #93c5ff;
}

/* ================================
   SECTIONS & CARDS
=================================== */

.kd-section {
    margin-bottom: 36px;
}

.kd-section h2 {
    font-size: 18px;
    margin-bottom: 14px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.card-grid.small .news-card {
    font-size: 13px;
}

.feature-card,
.news-card,
.card {
    background: radial-gradient(circle at top left, #202a5f, #050814);
    border-radius: 16px;
    padding: 14px 14px 16px;
    border: 1px solid rgba(148, 163, 255, 0.3);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, border-color 0.15s;
}

.card {
    background: #020617;
    border-radius: 1rem;
    border-color: #1e293b;
    padding: 1rem 1.1rem;
}

.feature-card:hover,
.news-card:hover,
.card:hover {
    transform: translateY(-3px);
    border-color: rgba(248, 250, 252, 0.8);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.7);
}

.feature-card h3,
.news-card h3 {
    margin: 0 0 8px;
    font-size: 15px;
}

.feature-card p,
.news-card p {
    margin: 0;
    font-size: 13px;
    color: #c7d2ff;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.card-header h2 {
    font-size: 1rem;
    margin: 0 0 0.25rem;
}

.card-sub {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.section-link {
    font-size: 13px;
    color: #93c5ff;
    text-decoration: none;
}

/* ================================
   MARKET LAYOUT & TABLE
=================================== */

.market-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.4fr);
    gap: 1.25rem;
}

.table-wrapper {
    overflow-x: auto;
}

.coins-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.coins-table th,
.coins-table td {
    padding: 0.5rem 0.4rem;
    text-align: right;
    border-bottom: 1px solid #0f172a;
}

.coins-table thead {
    background: #020617;
}

.coins-table th {
    color: #9ca3af;
    font-weight: 500;
}

.coins-table tbody tr:hover {
    background: #020617;
    cursor: pointer;
}

.coin-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.coin-icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
}

.coin-name {
    font-size: 0.8rem;
}

.coin-symbol {
    font-size: 0.7rem;
    color: #9ca3af;
}

.loading-row,
.error-row {
    text-align: center;
    color: #9ca3af;
}

/* Chart */
.chart-card {
    min-height: 280px;
}

#coinChart {
    width: 100%;
    max-height: 260px;
}

.chart-note {
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: #94a3b8;
}

/* ================================
   FOOTERS
=================================== */

/* KD homepage footer */
.kd-footer {
    border-top: 1px solid rgba(75, 85, 99, 0.8);
    background: #020617;
}

.kd-footer .footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 16px 18px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: #9ca3af;
}

.kd-footer .footer-links {
    display: flex;
    gap: 12px;
}

.kd-footer .footer-links a {
    text-decoration: none;
    color: #9ca3af;
}

/* Site-wide footer (market pages) */
.site-footer {
    border-top: 1px solid #1e293b;
    background: #020617;
}

.site-footer .footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 2rem;
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: #cbd5f5;
}

.footer-cols h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.footer-cols a {
    display: block;
    margin-bottom: 0.3rem;
    color: #9ca3af;
    font-size: 0.78rem;
}

.footer-cols a:hover {
    color: #e5e7eb;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

.footer-social {
    display: flex;
    gap: 0.35rem;
}

.footer-social a {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid #1e293b;
    background: #020617;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.footer-social a:hover {
    border-color: #22c55e;
    color: #22c55e;
}

/* ================================
   AUTH PAGES
=================================== */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: radial-gradient(circle at top, rgba(34,197,94,0.15), transparent), #020617;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #020617;
    border-radius: 1rem;
    border: 1px solid #1e293b;
    padding: 1.25rem 1.5rem;
}

.auth-card h1 {
    font-size: 1.15rem;
    margin: 0 0 0.7rem;
}

.auth-card p {
    margin: 0 0 1rem;
    font-size: 0.8rem;
    color: #9ca3af;
}

.auth-field {
    margin-bottom: 0.7rem;
}

.auth-field label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.auth-field input {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border-radius: 0.6rem;
    border: 1px solid #1e293b;
    background: #020617;
    color: #e5e7eb;
    font-size: 0.85rem;
}

.auth-field input::placeholder {
    color: #6b7280;
}

/* ================================
   RESPONSIVE
=================================== */

@media (max-width: 960px) {
    .header-inner {
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-nav {
        display: none; /* simple mobile behaviour */
    }

    .search-box {
        max-width: 100%;
        order: 3;
    }

    .market-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .kd-header-inner {
        flex-wrap: wrap;
    }

    .kd-nav {
        order: 3;
        width: 100%;
        justify-content: space-around;
        margin-inline-start: 0;
    }

    .kd-auth {
        margin-inline-start: auto;
    }
    
    /* ============= SOCIAL ICONS IN HEADER ============= */

.kd-social {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-inline-start: auto; /* pushes icons towards the right/left depending on RTL */
}

.kd-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #020617;
    border: 1px solid #1e293b;
    padding: 4px;
    box-shadow: 0 0 0 rgba(34, 197, 94, 0); /* start no glow */
    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        transform 0.12s ease,
        box-shadow 0.18s ease;
}

.kd-social img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* hover: small neon effect */
.kd-social a:hover {
    border-color: #22c55e;
    background: #020617;
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.6);
}

/* tiny pulse animation for a “live” feeling (optional) */
.kd-social a:nth-child(1) { animation: kd-pulse 3.5s infinite ease-in-out; }
.kd-social a:nth-child(3) { animation: kd-pulse 4s infinite ease-in-out 0.6s; }
.kd-social a:nth-child(5) { animation: kd-pulse 4.5s infinite ease-in-out 1.1s; }

@keyframes kd-pulse {
    0%, 80%, 100% { box-shadow: 0 0 0 rgba(34, 197, 94, 0); }
    40%          { box-shadow: 0 0 10px rgba(34, 197, 94, 0.45); }
}

/* Mobile: keep header clean, shrink or hide icons if needed */
@media (max-width: 768px) {
    .kd-social {
        gap: 4px;
    }
    .kd-social a {
        width: 24px;
        height: 24px;
        padding: 3px;
    }
}
/* Social icons in header */
.kd-social {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-inline: 8px;
}

.kd-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #020617;
    border: 1px solid #1e293b;
    padding: 4px;
    box-shadow: 0 0 0 rgba(34, 197, 94, 0);
    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        transform 0.12s ease,
        box-shadow 0.18s ease;
}

.kd-social img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* hover = neon glow */
.kd-social a:hover {
    border-color: #22c55e;
    background: #020617;
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.6);
}

/* subtle pulsing on some icons (optional) */
.kd-social a:nth-child(1),
.kd-social a:nth-child(3),
.kd-social a:nth-child(5) {
    animation: kd-pulse 4s infinite ease-in-out;
}

@keyframes kd-pulse {
    0%, 80%, 100% { box-shadow: 0 0 0 rgba(34, 197, 94, 0); }
    40%          { box-shadow: 0 0 10px rgba(34, 197, 94, 0.45); }
}

/* Mobile: small but still visible */
@media (max-width: 768px) {
    .kd-social {
        gap: 4px;
    }
    .kd-social a {
        width: 22px;
        height: 22px;
        padding: 3px;
    }
    .coin-range-btn.active {
    border-color: #22c55e;
    color: #22c55e;
}

/* ==== Related / Trending coin cards (coin.php) ==== */

.coin-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

/* ==== COIN PAGE ==== */

.coin-top {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
}

.coin-info-box {
    background: #0f172a;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid #1e293b;
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1 1 320px;
}

.coin-big-icon {
    width: 64px;
    height: 64px;
}

.coin-title {
    font-size: 1.4rem;
    font-weight: 700;
}

.coin-basic-row {
    display: flex;
    gap: 8px;
    color: #94a3b8;
}

.coin-price-row {
    margin-top: 10px;
    font-size: 1.4rem;
    font-weight: 700;
}

.coin-change24.up { color: #4ade80; }
.coin-change24.down { color: #fb7185; }

.coin-stats-box {
    background: #0f172a;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid #1e293b;
    flex: 1 1 280px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.stat-item span {
    color: #94a3b8;
    font-size: 0.83rem;
}

.coin-desc {
    margin-top: 20px;
    background: #0f172a;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #1e293b;
}

.coin-chart-box {
    margin-top: 20px;
    background: #0f172a;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #1e293b;
}

.chart-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.chart-range-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.chart-range-buttons button {
    padding: 6px 12px;
    border-radius: 8px;
    background: #1e293b;
    border: none;
    color: #fff;
    cursor: pointer;
}

.chart-range-buttons button.active {
    background: #2563eb;
}

.chart-wrapper {
    height: 350px;
}



    
}
