/* =========================
   RENK DEĞİŞKENLERİ
   (EKRAN GÖRÜNTÜSÜ PALETİNE YAKIN)
   ========================= */
:root {
    --bg-main: #020308;
    --panel: #16181f;
    --border: #2a303a;
    --accent: #263641;
    --accent-soft: #1f2a34;
    --text: #f5f5f7;
    --muted: #9aa0ad;
}

/* =========================
   GENEL SAYFA STİLİ
   ========================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg-main);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui,
    sans-serif;
    padding-bottom: 90px; /* sabit footer için boşluk */
}

.app-shell {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;   /* flex-end → flex-start */
    padding: 40px 16px 16px;   /* biraz üst boşluk */
}
/* =========================
   TOPBAR
   ========================= */

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(5, 5, 5, 0.96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-subtle);
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.7rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Logo */

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;

    text-decoration: none; /* Alt çizgi kalksın */
    color: inherit;        /* Yazı normal renk ile kalsın */
}

.logo img {
    height: 32px;
    width: 32px;
    border-radius: 999px;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* Header buttons */

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* =========================
   PANEL
   ========================= */

.converter-panel {
    width: 100%;
    max-width: 430px;
    margin-top: 40px;
    background: var(--panel);
    border-radius: 24px;   /* eskisi: 24px 24px 0 0 */
    padding: 20px 20px 28px;
    border: 1px solid var(--border);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
}

.converter-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 12px;
}

.close-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: #0b0d11;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
}

.close-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.converter-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

/* =========================
   FORM ALANLARI
   ========================= */

.field-label {
    display: block;
    margin-top: 20px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--muted);
}

.fake-input {
    background: #11131a;
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 14px 16px;
    font-size: 15px;
}

/* =========================
   CUSTOM DROPDOWN
   ========================= */


/* =========================
   CUSTOM DROPDOWN
   ========================= */

.dropdown {
    position: relative;
    background: #11131a;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
}

.dropdown-selected {
    font-size: 15px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Sağdaki küçük ok */
.dropdown-selected::after {
    content: "▾";
    font-size: 12px;
    color: var(--muted);
    margin-left: 8px;
}

/* Menü */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #1a1c23cc; /* hafif şeffaf */
    backdrop-filter: blur(16px);
    border-radius: 16px;
    border: 1px solid var(--border);
    /* ÖNEMLİ KISIM: kendi içinde scroll */
    max-height: 40vh;              /* istersen 320px de yapabilirsin */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: none;
    z-index: 1000;
}

/* Açıkken göster */
.dropdown.open .dropdown-menu,
.dropdown.is-open .dropdown-menu {
    display: block;
}

.dropdown-item {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--accent);
}

/* Dropdown açıksa body scroll kilidi */
body.dropdown-open {
    overflow: hidden;
}

/* =========================
   BUTON
   ========================= */

.primary-btn {
    margin-top: 24px;
    width: 100%;
    border-radius: 18px;
    padding: 14px 18px;
    border: none;
    background: var(--accent);
    color: var(--text);
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    font-size: 15px;
}

.primary-btn:active {
    transform: scale(0.98);
}

/* =========================
   FOOTER (SABİT)
   ========================= */

.app-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #101218;
    border-top: 1px solid var(--border);
    padding: 10px 14px;
    z-index: 999;
}

.app-footer-inner {
    max-width: 430px;
    margin: 0 auto;

    display: flex;
    flex-direction: column; /* yukarıdan aşağı */
    align-items: center;    /* yatay olarak merkezle */
    justify-content: center;
    gap: 10px;

    font-size: 12px;
    color: var(--muted);
}

.footer-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--text);
    text-decoration: underline;
}

.footer-separator {
    opacity: 0.6;
}

.footer-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-badges img {
    height: 32px;
    display: block;
    border-radius: 6px;
}

/* Küçük ekranlarda footer kolon olsun */
@media (max-width: 480px) {
    .app-footer-inner {
        flex-direction: column; /* yukarıdan aşağı */
        align-items: center;    /* yatay olarak merkezle */
    }

    .footer-badges img {
        height: 32px;
    }
}

.field-ed50-region.is-hidden {
    display: none;
}

/* =========================
   INPUT ALANLARI (GENEL)
   ========================= */

.input-section {
    margin-top: 20px;
}

.input-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* Tek satırlık text field, dropdown’larla aynı stil */
.input-textfield {
    background: #11131a;
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 14px 16px;
    font-size: 15px;
    color: var(--text);
    width: 100%;
}

.input-textfield::placeholder {
    color: var(--muted);
}

/* =========================
   DMS SATIRI
   ========================= */

.dms-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.hemisphere-btn {
    min-width: 64px;
    height: 56px;
    border-radius: 999px;
    border: none;
    background: var(--accent);
    color: var(--text);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
}

.hemisphere-btn:active {
    transform: scale(0.97);
}

/* DMS içindeki küçük textfield’lar */
.dms-input {
    background: #11131a;
    border-radius: 999px;
    border: 1px solid var(--border);
    padding: 14px 12px;
    font-size: 15px;
    color: var(--text);
    width: 100%;
    text-align: center;
}

.dms-input::placeholder {
    color: var(--muted);
}


/* =========================
   RESULT BOX (iOS style)
   ========================= */

.result-box{
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.result-item{
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.result-label{
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

/* Clickable pill */
.result-pill{
    position: relative;

    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 999px;

    padding: 14px 16px;
    min-height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;

    color: var(--text);
    font-size: 15px;
    line-height: 1.2;

    overflow-wrap: anywhere;

    user-select: none;
    cursor: pointer;

    box-shadow:
            0 8px 22px rgba(0,0,0,0.35),
            inset 0 1px 0 rgba(255,255,255,0.06);

    transition: transform .08s ease, border-color .15s ease, background .15s ease;
}

.result-pill:hover{ border-color: rgba(255,255,255,0.18); }
.result-pill:active{ transform: scale(0.99); }

/* Error pill */
.result-pill.is-error{
    border-color: rgba(255,0,102,0.35);
    background: rgba(255,0,102,0.08);
    box-shadow: none;
}

/* Copy feedback */
.result-pill.copied{
    border-color: rgba(132,169,140,0.55);
    box-shadow:
            0 10px 26px rgba(0,0,0,0.40),
            0 0 0 3px rgba(132,169,140,0.18),
            inset 0 1px 0 rgba(255,255,255,0.06);
}

.result-pill .copy-hint{
    margin-left: 10px;
    font-size: 12px;
    color: var(--muted);
    opacity: 0.7;
}

/* İstersen mobilde gizle */
@media (max-width: 480px){
    .result-pill .copy-hint{ display:none; }
}

.result-pill .copy-toast{
    position: absolute;
    transform: translateY(-46px);
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.12);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--text);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}

.result-pill.copied .copy-toast{ opacity: 1; }