/* ================================================
   Üçer Sarrafiye — Altın & Döviz Kurları
   v2.0 — Tamamen yeniden tasarlanmış arayüz
   ================================================ */

/* === Variables === */
:root {
    --gold: #B18F4F;
    --gold-light: #d4b476;
    --gold-lighter: #f5edd9;
    --gold-dark: #8a6f3a;
    --navy: #34454E;
    --navy-light: #4a6270;
    --navy-dark: #263238;
    --navy-darker: #1a2a31;
    --white: #ffffff;
    --bg: #f0f2f5;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #868e96;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --green: #0d9e3f;
    --green-light: #e6f9ee;
    --red: #d32f2f;
    --red-light: #fce8e8;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--gray-900);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Header === */
.header {
    background: var(--navy-dark);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    height: 72px;
}

/* Logo — beyaz arka plan */
.logo-wrap {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 6px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    height: 52px;
}

.logo-wrap img {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
}

.header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.header-title {
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gold-light);
    font-size: 0.78rem;
    font-weight: 500;
}

.clock-icon {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

.live-dot {
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    flex-shrink: 0;
    animation: livePulse 2s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

/* === Main === */
.main {
    flex: 1;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 24px 40px;
}

/* === Error State === */
.error-state {
    text-align: center;
    padding: 80px 24px;
    max-width: 420px;
    margin: 0 auto;
}

.error-state .error-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    color: var(--gold);
}

.error-state .error-icon svg {
    width: 100%;
    height: 100%;
}

.error-state h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 8px;
}

.error-state p {
    color: var(--gray-600);
    font-size: 0.95rem;
    margin-bottom: 28px;
    line-height: 1.6;
}

.error-state button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gold);
    color: var(--white);
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.error-state button svg {
    width: 18px;
    height: 18px;
}

.error-state button:hover {
    background: var(--gold-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(177, 143, 79, 0.3);
}


/* === Panels Grid — yan yana === */
.panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

/* === Panel === */
.panel {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 2px solid transparent;
}

.panel-doviz .panel-header {
    background: linear-gradient(135deg, var(--navy-dark), var(--navy));
    border-bottom-color: var(--navy);
    color: var(--white);
}

.panel-altin .panel-header {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    border-bottom-color: var(--gold);
    color: var(--white);
}

.panel-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
}

.panel-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--white);
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* === Panel Table === */
.panel-table {
    width: 100%;
}

.panel-table-head {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 20px;
    padding: 11px 22px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
}

.panel-table-head .col-price {
    width: 140px;
    text-align: right;
}

.panel-table-body {
    max-height: none;
    overflow: visible;
}

/* === Rate Row === */
.rate-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 20px;
    padding: 15px 22px;
    border-bottom: 1px solid var(--gray-100);
    transition: background-color var(--transition);
    align-items: center;
    position: relative;
}

.rate-row:last-child {
    border-bottom: none;
}

.rate-row:hover {
    background: var(--gray-50);
}

.rate-row .col-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.rate-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--navy-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rate-row .col-price {
    width: 140px;
    text-align: right;
    font-weight: 700;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s, background-color 0.5s;
    padding: 6px 14px;
    border-radius: 6px;
    position: relative;
}

.rate-row .col-price.buy,
.rate-row .col-price.sell {
    color: var(--gray-800);
}

/* === Fiyat Değişim Animasyonları === */
/* Fiyat yükseldi — yeşil parlama */
.rate-row .col-price.flash-up {
    animation: flashUp 1.5s ease;
}

@keyframes flashUp {
    0% {
        background-color: var(--green);
        color: var(--white);
    }
    40% {
        background-color: var(--green-light);
        color: var(--green);
    }
    100% {
        background-color: transparent;
        color: var(--gray-800);
    }
}

/* Fiyat düştü — kırmızı parlama */
.rate-row .col-price.flash-down {
    animation: flashDown 1.5s ease;
}

@keyframes flashDown {
    0% {
        background-color: var(--red);
        color: var(--white);
    }
    40% {
        background-color: var(--red-light);
        color: var(--red);
    }
    100% {
        background-color: transparent;
        color: var(--gray-800);
    }
}

/* Satır highlight */
.rate-row.row-changed {
    animation: rowHighlight 2s ease;
}

@keyframes rowHighlight {
    0% { background-color: rgba(177, 143, 79, 0.08); }
    100% { background-color: transparent; }
}

/* === Footer === */

/* === Contact Bar === */
.contact-bar {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    padding: 20px 24px;
}

.contact-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 28px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--gray-600);
    line-height: 1;
}

.contact-item svg {
    width: 15px;
    height: 15px;
    min-width: 15px;
    min-height: 15px;
    max-width: 15px;
    max-height: 15px;
    flex-shrink: 0;
    display: block;
}

.contact-icon {
    width: 15px;
    height: 15px;
    min-width: 15px;
    min-height: 15px;
    max-width: 15px;
    max-height: 15px;
    flex-shrink: 0;
    color: var(--gold);
    opacity: 0.7;
    display: inline-block;
    vertical-align: middle;
    overflow: hidden;
}

.contact-item a {
    color: var(--gray-600);
    text-decoration: none;
    transition: color var(--transition);
}

.contact-item a:hover {
    color: var(--gold-dark);
}

.footer {
    background: var(--navy-darker);
    color: rgba(255, 255, 255, 0.6);
    padding: 18px 24px;
    margin-top: auto;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.78rem;
}

.footer .copyright {
    color: var(--gold-light);
    font-weight: 600;
}

.footer .disclaimer {
    color: rgba(255, 255, 255, 0.4);
}

/* === Toast (güncelleme bildirimi) === */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--navy);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--gold-light);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ==========================
   RESPONSIVE
   ========================== */

/* Tablet */
@media (max-width: 900px) {
    .panels {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .header-inner {
        height: 64px;
        gap: 16px;
    }

    .logo-wrap {
        height: 46px;
        padding: 5px 12px;
    }

    .logo-wrap img {
        height: 34px;
    }

    .header-title {
        font-size: 1rem;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .header-inner {
        height: auto;
        padding: 12px 16px;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .logo-wrap {
        height: 50px;
        padding: 6px 20px;
    }

    .logo-wrap img {
        height: 38px;
    }

    .header-info {
        align-items: center;
        text-align: center;
    }

    .header-title {
        font-size: 0.95rem;
    }

    .header-meta {
        font-size: 0.72rem;
    }

    .main {
        padding: 16px 12px 28px;
    }

    .panels {
        gap: 16px;
    }

    .panel-header {
        padding: 14px 16px;
        gap: 10px;
    }

    .panel-icon {
        width: 32px;
        height: 32px;
    }

    .panel-icon svg {
        width: 17px;
        height: 17px;
    }

    .panel-header h2 {
        font-size: 0.95rem;
    }

    .panel-table-head {
        padding: 9px 16px;
        font-size: 0.65rem;
        gap: 12px;
    }

    .panel-table-head .col-price {
        width: 110px;
    }

    .rate-row {
        padding: 13px 16px;
        gap: 12px;
    }

    .rate-name {
        font-size: 0.85rem;
    }

    .rate-row .col-price {
        font-size: 0.9rem;
        width: 110px;
        padding: 4px 8px;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 4px;
    }

    .contact-inner {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }

    .contact-item {
        font-size: 0.76rem;
    }

    .contact-item a {
        text-align: center;
    }

    .toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        justify-content: center;
        font-size: 0.78rem;
        padding: 10px 16px;
    }
}

/* Tiny screens */
@media (max-width: 380px) {
    .panel-table-head .col-price,
    .rate-row .col-price {
        width: 90px;
        font-size: 0.78rem;
        padding: 3px 6px;
    }

    .rate-row {
        gap: 8px;
    }

    .rate-name {
        font-size: 0.8rem;
    }

    .logo-wrap img {
        height: 32px;
    }

    .header-title {
        font-size: 0.85rem;
    }
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}
