:root {
    --bg-gradient-start: #1e293b;
    --bg-gradient-end: #020617;
    --card-bg: rgba(15, 23, 42, 0.85);
    --accent-pink: #f9739b;
    --accent-yellow: #facc15;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, var(--bg-gradient-start) 0, var(--bg-gradient-end) 55%, #000 100%);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
}

/* Tema geçişinde fade/transition efektleri */
html, body,
.app-shell,
.currency-card,
footer,
.update-chip,
.theme-toggle,
.currency-code-pill,
.card-grid-title,
.footer-note,
.currency-price,
.currency-meta {
    transition:
        background-color 0.35s ease,
        background 0.35s ease,
        color 0.35s ease,
        box-shadow 0.35s ease,
        border-color 0.35s ease;
}

body.theme-switching {
    transition: filter 0.35s ease, transform 0.35s ease;
    filter: brightness(0.98);
    transform: scale(1.002);
}

/* AÇIK / PEMBE TEMA */
body.light {
    --bg-gradient-start: #ffe4f1;
    --bg-gradient-end: #ffd0e7;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #4b5563;
    --text-muted: #6b7280;
    --accent-pink: #ff4fa3;
    --accent-yellow: #ffda55;

    background: radial-gradient(circle at top, #ffe4f1 0, #ffd0e7 55%, #ffffff 100%);
    color: var(--text-main);
}

.app-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.app-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 24px;
    text-align: center;
    position: relative; /* tema butonu için anchor */
}

@media (min-width: 600px) {
    .app-header {
        text-align: left;
    }
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

@media (min-width: 600px) {
    .brand-row {
        justify-content: flex-start;
    }
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f9739b, #fb7185);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(248, 113, 113, 0.45);
}

.brand-logo span {
    font-weight: 700;
    color: #0f172a;
    font-size: 20px;
}

.brand-title {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.brand-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.update-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    align-self: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(31, 41, 55, 0.85);
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 6px;
}

.update-text-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.update-countdown {
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.9;
}

body.light .update-countdown {
    color: #9b4f76;
}


@media (min-width: 600px) {
    .update-chip {
        align-self: flex-start;
    }
}

body.light .update-chip {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-muted);
}

.update-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.15);
    transition: background-color 0.6s ease, box-shadow 0.6s ease;
}

/* Dot kırmızıya yaklaştığında kalp atışı gibi pulse efekti */
@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.35);
    }
}

.update-dot.dot-pulse {
    animation: dotPulse 1s ease-out infinite;
}


.update-label {
    font-weight: 500;
}

.card-grid-title {
    margin: 26px 0 12px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-grid-title .material-icons {
    font-size: 18px;
    color: var(--accent-pink);
}

.currency-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 18px 18px 14px;
    margin-bottom: 18px;
    box-shadow:
        0 20px 35px rgba(15, 23, 42, 0.9),
        0 0 0 1px rgba(148, 163, 184, 0.15);
    backdrop-filter: blur(18px);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border 0.2s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.currency-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(248, 113, 113, 0.15), transparent 55%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.currency-card:hover {
    transform: translateY(-4px) translateZ(0);
    box-shadow:
        0 26px 50px rgba(15, 23, 42, 0.96),
        0 0 0 1px rgba(248, 113, 113, 0.45);
    border-color: rgba(248, 113, 113, 0.7);
}

.currency-card:hover::before {
    opacity: 1;
}

body.light .currency-card {
    box-shadow:
        0 14px 30px rgba(248, 113, 165, 0.25),
        0 0 0 1px rgba(248, 113, 165, 0.45);
    border-color: rgba(248, 113, 165, 0.9);
}

body.light .brand-logo {
    background: linear-gradient(135deg, #ff7abf, #ffa4d7);
}

.currency-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.currency-name {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.currency-code-pill {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.5);
    color: var(--text-muted);
}

body.light .currency-code-pill {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(248, 113, 165, 0.6);
}

.currency-main {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
}

.currency-price {
    font-size: 20px;
    font-weight: 600;
}

.currency-price span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.change-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.change-up {
    background: rgba(22, 163, 74, 0.15);
    color: #4ade80;
}

.change-down {
    background: rgba(220, 38, 38, 0.18);
    color: #fca5a5;
}

.change-neutral {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-muted);
}

.change-chip .material-icons {
    font-size: 16px;
}

.currency-meta {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.currency-buy-sell div {
    margin: 2px 0;
    line-height: 1.25;
    font-weight: 500;
}


.gif-wrapper {
    margin-top: 12px;
    border-radius: 14px;
    overflow: hidden;
    max-height: 240px;
}

.gif-wrapper img {
    width: 100%;
    display: block;
    object-fit: cover;
    filter: saturate(1.1);
}

.secondary-section {
    margin-top: 18px;
}

.secondary-section .currency-card {
    padding-bottom: 10px;
}

.secondary-section .gif-wrapper {
    max-height: 200px;
}

.error-banner {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.1);
    color: #fecaca;
    font-size: 13px;
    display: none;
}

footer {
    margin-top: auto;
    background: radial-gradient(circle at top, #020617 0, #020617 40%, #000 100%);
    border-top: 1px solid rgba(31, 41, 55, 0.9);
    padding: 18px 16px 24px;
}

body.light footer {
    background: radial-gradient(circle at top, #ffe4f1 0, #ffd0e7 40%, #fed7e2 100%);
    border-top-color: rgba(248, 113, 165, 0.5);
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.footer-top {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    margin-bottom: 14px;
}

@media (min-width: 768px) {
    .footer-top {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.footerCounter img {
    filter: grayscale(1) invert(0.9);
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.footerCounter img:hover {
    opacity: 1;
}

.footer-note {
    font-size: 11px;
    color: #64748b;
    text-align: center;
    margin-top: 10px;
}

body.light .footer-note {
    color: #9b4f76;
}

iframe {
    border-radius: 18px !important;
    border: 1px solid rgba(51, 65, 85, 0.9);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.9);
}

body.light iframe {
    border-color: rgba(248, 113, 165, 0.8);
    box-shadow: 0 16px 35px rgba(248, 113, 165, 0.4);
}

/* Tema toggle butonu */
.theme-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.15s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.25);
    z-index: 20;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

.theme-toggle span {
    color: #ffffff;
    font-size: 22px;
}

body.light .theme-toggle {
    background: rgba(255, 180, 220, 0.25);
    border-color: rgba(248, 113, 165, 0.6);
    box-shadow: 0 8px 18px rgba(248, 113, 165, 0.35);
}

body.light .theme-toggle span {
    color: #ff2f88;
}

/* Mobilde header ile tema butonunun çakışmasını engelle */
@media (max-width: 600px) {
    .app-header {
        padding-top: 56px;  /* Tema butonu kadar boşluk aç */
    }

    .theme-toggle {
        top: 12px;          /* Ekranın tepesinden biraz aşağı */
        right: 12px;        /* Kenardan biraz içeri */
        width: 36px;
        height: 36px;
    }

    .brand-row {
        flex-direction: column;
        gap: 6px;
    }

    .brand-title {
        font-size: 22px;
    }

    .brand-subtitle {
        font-size: 12px;
    }
}

.gram-input {
    width: 48px;
    padding: 3px 6px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
    font-size: 14px;
    margin-right: 6px;
    text-align: center;
}

body.light .gram-input {
    background: rgba(255,255,255,0.8);
    border-color: rgba(0,0,0,0.2);
    color: #444;
}

.original-price {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}


.qty-input {
    min-width: 30px;   /* 4 hane için ideal */
    max-width: 140px;  /* çok genişlemeyi engelle */
    padding: 4px 6px;
    margin-right: 8px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-main);
    font-size: 12px;
    text-align: center;      /* 🔹 SAYIYI ORTALA */
    transition: width 0.15s ease;
}

body.light .qty-input {
    background: rgba(255, 255, 255, 0.9);
    color: #4b5563;
    border-color: rgba(248, 113, 165, 0.6);
}

/* Number input oklarını gizle — Chrome, Safari, Edge */
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox için */
.qty-input {
    -moz-appearance: textfield;
}



.original-price {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}


