@import 'tailwindcss';

@source '../views/site/**/*.blade.php';
@source '../js/site.js';

/*
 * Fuelixa site teması.
 *
 * Arayüz: beyaz paneller, soğuk açık gri zemin, 1px çizgiler (harita uygulaması dili).
 * İmza öğesi: "fiyat panosu" — istasyon tabelasından gelen asfalt zemin + yeşil/amber
 * rakamlar. Yeşil (pompa) birincil renk ve "en ucuz"; amber sürücü bildirimi; kırmızı artış.
 * Yazı: Bricolage Grotesque (başlık ve büyük rakam), Instrument Sans (arayüz).
 */
@theme {
    --font-sans: 'Manrope', ui-sans-serif, system-ui, sans-serif;
    --font-display: 'Manrope', ui-sans-serif, system-ui, sans-serif;

    /* Fuelixa Design System tokenları (fx-*) */
    --color-ink: #0b1f33;
    --color-ink-soft: #5b6b7d;
    --color-ink-faint: #93a1b0;
    --color-paper: #ffffff;
    --color-chalk: #f5f7fa;
    --color-chalk-deep: #e9eef3;
    --color-line: #e1e7ee;
    --color-line-strong: #c8d2dd;

    --color-primary: #fd7a08;
    --color-primary-deep: #f05a06;
    --color-primary-soft: #fff1e4;
    --color-pump: #c2470a;
    --color-pump-deep: #9a3708;
    --color-pump-soft: #fff1e4;
    --color-led: #0e8a7d;
    --color-led-soft: #e0f4f1;
    --color-rise: #c94a4a;
    --color-rise-soft: #f9e6e6;
    --color-fall: #2e8b57;

    --color-dark: #0b1f33;
    --color-dark-2: #16304a;
    --color-board: #0b1f33;
    --color-board-line: #1f3a56;
    --color-board-text: #9fb1c5;
    --color-board-green: #ffffff;
    --color-board-amber: #5eead4;

    --radius-panel: 12px;
    --radius-ctl: 8px;
    --radius-lg: 18px;
    --shadow-float: 0 1px 2px rgba(11, 31, 51, 0.08);
}

@layer base {
    html {
        scroll-behavior: smooth;
    }

    body {
        background: var(--color-chalk);
        color: var(--color-ink);
        -webkit-font-smoothing: antialiased;
        font-size: 15px;
    }

    [x-cloak] {
        display: none !important;
    }

    summary::-webkit-details-marker {
        display: none;
    }

    :focus-visible {
        outline: 2px solid var(--color-pump);
        outline-offset: 2px;
    }

    select,
    input,
    button {
        font: inherit;
    }

    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation: none !important;
            transition: none !important;
            scroll-behavior: auto !important;
        }
    }
}

@layer components {
    .wrap {
        @apply mx-auto w-full max-w-[1240px] px-4 sm:px-6;
    }

    /* Yazı */
    .display {
        font-family: var(--font-display);
        font-weight: 700;
        letter-spacing: -0.02em;
        line-height: 1.1;
    }

    .headline {
        font-family: var(--font-display);
        font-weight: 600;
        letter-spacing: -0.015em;
        line-height: 1.15;
    }

    .num {
        font-family: var(--font-display);
        font-variant-numeric: tabular-nums;
        font-weight: 700;
        letter-spacing: -0.02em;
    }

    .num-sm {
        font-variant-numeric: tabular-nums;
        font-weight: 600;
    }

    .label {
        @apply text-[13px] font-medium text-ink-soft;
    }

    /* Üst çubuk */
    .topbar {
        @apply sticky top-0 z-[700] border-b border-line bg-paper text-ink;
    }

    .nav-link {
        @apply inline-flex h-9 items-center rounded-[var(--radius-ctl)] px-3 text-sm font-semibold text-ink-soft transition-colors hover:bg-chalk hover:text-ink;
    }

    .nav-link-active {
        @apply text-ink;
        box-shadow: inset 0 -2px 0 var(--color-primary);
        border-radius: 0;
    }

    /* Düğmeler */
    .btn {
        @apply inline-flex h-10 items-center justify-center gap-2 whitespace-nowrap rounded-[var(--radius-ctl)] px-4 text-sm font-semibold transition-colors disabled:opacity-50;
    }

    .btn-sm {
        @apply h-8 px-3 text-[13px];
    }

    .btn-primary {
        @apply text-white;
        background: linear-gradient(100deg, #f05a06, #fd8a07);
    }

    .btn-primary:hover {
        background: linear-gradient(100deg, #d94f05, #f05a06);
    }

    .btn-dark {
        @apply bg-dark text-white hover:bg-dark-2;
    }

    .btn-ghost {
        @apply border border-line-strong bg-paper text-ink hover:bg-chalk;
    }

    .btn-quiet {
        @apply bg-chalk text-ink hover:bg-chalk-deep;
    }

    .btn-icon {
        @apply inline-flex size-10 items-center justify-center rounded-[var(--radius-ctl)] border border-line-strong bg-paper text-ink hover:bg-chalk;
    }

    /* Paneller ve alanlar */
    .panel {
        @apply rounded-[var(--radius-panel)] border border-line bg-paper;
    }

    .card {
        @apply rounded-[var(--radius-panel)] border border-line bg-paper;
    }

    .field {
        @apply h-10 w-full rounded-[var(--radius-ctl)] border border-line-strong bg-paper px-3 text-sm text-ink placeholder:text-ink-faint focus:border-pump focus:outline-none;
    }

    select.field {
        @apply pr-8;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%235b6572' stroke-width='1.8'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 8px center;
        background-size: 16px;
    }

    .chip {
        @apply inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-full border border-line-strong bg-paper px-3 text-[13px] font-medium text-ink transition-colors hover:bg-chalk;
    }

    .chip-active {
        @apply border-dark bg-dark text-white hover:bg-dark;
    }

    .tag {
        @apply inline-flex h-6 items-center rounded-md px-2 text-xs font-semibold;
    }

    .tag-led {
        @apply bg-led-soft text-[#0b6b61];
    }

    .tag-pump {
        @apply bg-pump-soft text-pump-deep;
    }

    .tag-chalk {
        @apply bg-chalk text-ink-soft;
    }

    /* Liste satırı (harita yanındaki liste, yakındakiler, rota üzerindekiler) */
    .row {
        @apply flex items-center gap-3 border-b border-line px-4 py-3 transition-colors last:border-b-0 hover:bg-chalk;
    }

    .row-selected {
        @apply bg-primary-soft hover:bg-primary-soft;
    }

    /* FuelPrice: fiyat görsel öğedir — rakam baskın, birim ve bağlam küçük */
    .fuel-price {
        font-family: var(--font-display);
        font-variant-numeric: tabular-nums;
        font-weight: 800;
        letter-spacing: -0.03em;
        line-height: 0.95;
    }

    .fuel-price-best {
        background-image: linear-gradient(90deg, #f05a06, #feb708);
        background-size: 100% 0.13em;
        background-position: 0 100%;
        background-repeat: no-repeat;
    }

    .fuel-unit {
        @apply text-[13px] font-medium text-ink-soft;
    }

    .delta-up {
        color: var(--color-rise);
    }

    .delta-down {
        color: var(--color-fall);
    }

    /* Fiyat panosu — imza bileşen */
    .board {
        background: var(--color-board);
        color: #f3f4f2;
        border-radius: var(--radius-lg);
    }

    .board-cell {
        @apply flex flex-col gap-1 px-5 py-4;
    }

    .board-label {
        color: var(--color-board-text);
        font-size: 13px;
        font-weight: 500;
    }

    .board-price {
        font-family: var(--font-display);
        font-variant-numeric: tabular-nums;
        font-weight: 800;
        letter-spacing: -0.03em;
        line-height: 1;
        font-size: clamp(1.9rem, 2.8vw, 2.5rem);
        color: var(--color-board-green);
    }

    .board-price-amber {
        color: var(--color-board-amber);
    }

    .board-price-white {
        color: #ffffff;
    }

    .board-meta {
        color: var(--color-board-text);
        font-size: 12px;
    }

    .board-divide > * + * {
        border-top: 1px solid var(--color-board-line);
    }

    @media (min-width: 640px) {
        .board-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        }

        .board-grid > * + * {
            border-top: 0;
            border-left: 1px solid var(--color-board-line);
        }
    }

    /* Piyasa şeridi (fintech) */
    .ticker {
        @apply flex items-stretch gap-0 overflow-x-auto border-b border-line bg-paper;
        scrollbar-width: none;
    }

    .ticker::-webkit-scrollbar {
        display: none;
    }

    .ticker-item {
        @apply flex min-w-[196px] flex-1 items-center gap-3 border-r border-line px-4 py-2.5 transition-colors last:border-r-0 hover:bg-chalk;
    }

    .ticker-item-active {
        box-shadow: inset 0 -3px 0 var(--color-primary);
    }

    /* Harita çalışma alanı */
    .workspace {
        display: grid;
        grid-template-columns: 1fr;
    }

    @media (min-width: 1024px) {
        .workspace {
            grid-template-columns: 420px minmax(0, 1fr);
            height: calc(100vh - 56px - var(--ticker, 58px));
            min-height: 560px;
        }

        .workspace-side {
            overflow-y: auto;
            border-right: 1px solid var(--color-line);
            background: var(--color-paper);
        }

        .workspace-map {
            position: relative;
            height: 100%;
        }
    }

    .map-float {
        @apply rounded-[var(--radius-ctl)] border border-line bg-paper px-3 py-1.5 text-[13px] font-medium text-ink;
    }

    .fav-btn {
        @apply inline-flex shrink-0 items-center justify-center rounded-[var(--radius-ctl)] text-ink-faint transition-colors hover:bg-chalk hover:text-rise;
    }

    .fav-btn.is-on {
        @apply text-rise;
    }

    .fav-btn.is-on svg {
        fill: currentColor;
    }

    .source-dot {
        @apply inline-block size-2 rounded-full;
    }

    /* Marka işareti: markanın baş harfi (logo yokken) */
    .brand-mark {
        @apply inline-flex shrink-0 items-center justify-center rounded-[var(--radius-ctl)] bg-chalk text-sm font-bold text-ink-soft;
        font-family: var(--font-display);
    }

    /* Bölüm ayracı: kart yerine çizgi + boşluk */
    .section {
        @apply border-t border-line pt-8;
    }

    .eyebrow {
        @apply text-[12px] font-semibold uppercase tracking-[0.08em] text-ink-soft;
    }

    /* Yıldızlar */
    .stars {
        display: inline-flex;
        gap: 1px;
        color: var(--color-primary);
    }

    .stars svg {
        width: 16px;
        height: 16px;
    }

    .stars .is-off {
        color: var(--color-line-strong);
    }

    /* Leaflet */
    .leaflet-container {
        font-family: inherit;
        background: var(--color-chalk-deep);
    }

    .leaflet-control-zoom {
        border: 1px solid var(--color-line) !important;
        box-shadow: none !important;
        border-radius: var(--radius-ctl) !important;
        overflow: hidden;
    }

    .leaflet-control-zoom a {
        color: var(--color-ink) !important;
        border-bottom-color: var(--color-line) !important;
    }

    .leaflet-control-attribution {
        font-size: 10px !important;
        background: rgba(255, 255, 255, 0.8) !important;
    }

    .map-price {
        background: var(--color-dark);
        color: #fff;
        border-radius: 8px;
        padding: 3px 8px;
        font-family: var(--font-display);
        font-weight: 700;
        font-variant-numeric: tabular-nums;
        font-size: 13px;
        box-shadow: 0 2px 8px rgba(20, 26, 31, 0.25);
        white-space: nowrap;
        width: max-content;
        transform: translate(-50%, calc(-100% - 7px));
        position: relative;
        border: 1.5px solid #fff;
    }

    .map-price::after {
        content: '';
        position: absolute;
        left: 50%;
        bottom: -6px;
        width: 8px;
        height: 8px;
        background: inherit;
        transform: translateX(-50%) rotate(45deg);
        border-right: 1.5px solid #fff;
        border-bottom: 1.5px solid #fff;
    }

    .map-price-best {
        background: var(--color-primary-deep);
        color: #fff;
    }

    .map-price-best::after {
        background: var(--color-primary-deep);
    }

    .map-price-crowd {
        background: var(--color-led);
    }

    .map-dot {
        background: var(--color-dark);
        border: 2px solid #fff;
        border-radius: 999px;
        width: 11px;
        height: 11px;
        box-shadow: 0 1px 4px rgba(20, 26, 31, 0.35);
        transform: translate(-50%, -50%);
    }

    .is-focused .map-price,
    .is-focused .map-dot {
        outline: 3px solid var(--color-primary);
        outline-offset: 1px;
    }

    .map-me {
        width: 16px;
        height: 16px;
        border-radius: 999px;
        background: #1a73e8;
        border: 3px solid #fff;
        box-shadow: 0 0 0 8px rgba(26, 115, 232, 0.18);
        transform: translate(-50%, -50%);
    }

    /* Tablolar */
    .table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        font-size: 14px;
    }

    .table th {
        @apply text-[13px] font-medium text-ink-soft;
        text-align: right;
        padding: 0.6rem 0.75rem;
        border-bottom: 1px solid var(--color-line);
        white-space: nowrap;
    }

    .table td {
        padding: 0.7rem 0.75rem;
        text-align: right;
        border-bottom: 1px solid var(--color-line);
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    .table th:first-child,
    .table td:first-child {
        text-align: left;
        padding-left: 1rem;
    }

    .table tr:last-child td {
        border-bottom: 0;
    }

    /* Sayfa başlığı */
    .page-head {
        @apply border-b border-line bg-paper;
    }

    .prose-site p + p {
        margin-top: 0.9em;
    }
}
