/* ============================================================
   comn.lat — Ana stylesheet
   Tasarım: Minimal, text-odaklı, koyu accent, editorial feel
   ============================================================ */

/* ── Değişkenler ── */
:root {
    --clr-bg:        #f4f3f0;          /* ana arka plan: warm off-white */
    --clr-surface:   #ffffff;
    --clr-border:    #e0ddd8;
    --clr-text:      #1a1a1a;
    --clr-text-muted:#6b6561;
    --clr-accent:    #1a1a1a;          /* koyu accent */
    --clr-accent-light: #f0efec;
    --clr-link:      #2d5016;          /* subtle yeşil link */
    --clr-link-hover:#1a3a0a;
    --clr-danger:    #c0392b;
    --clr-success:   #27ae60;
    --clr-tag-bg:    #eae9e5;

    --font-head:     'DM Serif Display', 'Playfair Display', Georgia, serif;
    --font-body:     'Inter', 'Segoe UI', sans-serif;
    --font-mono:     'JetBrains Mono', 'Fira Code', monospace;

    --radius:        6px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
    --shadow-md:     0 2px 12px rgba(0,0,0,.1);
    --shadow-lg:     0 4px 24px rgba(0,0,0,.12);

    --header-h:      60px;
}

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

body {
    font-family: var(--font-body);
    background: var(--clr-bg);
    color: var(--clr-text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--clr-link); text-decoration: none; }
a:hover { color: var(--clr-link-hover); text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Header (sticky, minimal) ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: var(--clr-surface);
    border-bottom: 1px solid var(--clr-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: var(--shadow-sm);
}

.site-header .logo {
    font-family: var(--font-head);
    font-size: 1.35rem;
    color: var(--clr-text);
    text-decoration: none;
    letter-spacing: -.02em;
}
.site-header .logo span { color: var(--clr-link); }

.header-nav { display: flex; gap: 18px; align-items: center; }
.header-nav a { font-size: .82rem; color: var(--clr-text-muted); text-transform: uppercase; letter-spacing: .06em; text-decoration: none; }
.header-nav a:hover { color: var(--clr-text); text-decoration: none; }
.header-nav .btn-admin {
    background: var(--clr-accent);
    color: #fff;
    padding: 5px 14px;
    border-radius: var(--radius);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.header-nav .btn-admin:hover { background: #333; color: #fff; text-decoration: none; }

/* ── Page wrapper ── */
.page-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}
.page-wrap-wide {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* ── Section titles ── */
.section-label {
    font-family: var(--font-mono);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--clr-text-muted);
    margin-bottom: 10px;
}

.section-title {
    font-family: var(--font-head);
    font-size: 1.7rem;
    line-height: 1.25;
    color: var(--clr-text);
    margin-bottom: 6px;
}

.section-desc {
    color: var(--clr-text-muted);
    font-size: .9rem;
    margin-bottom: 24px;
}

/* ── Redirect Page — geri sayım ── */
.redirect-hero {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 10px;
    padding: 40px 36px 32px;
    box-shadow: var(--shadow-sm);
    text-align: left;
}

.redirect-hero .parsed-title {
    font-family: var(--font-head);
    font-size: 1.55rem;
    line-height: 1.3;
    color: var(--clr-text);
    margin-bottom: 8px;
}

.redirect-hero .parsed-desc {
    color: var(--clr-text-muted);
    font-size: .88rem;
    line-height: 1.55;
    margin-bottom: 28px;
    max-width: 640px;
}

.redirect-hero .target-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    color: var(--clr-link);
    word-break: break-all;
    margin-bottom: 28px;
}
.redirect-hero .target-link svg { flex-shrink: 0; }

/* Geri sayım kutusu */
.countdown-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: var(--clr-accent-light);
    border-radius: 8px;
    padding: 18px 28px;
    margin-bottom: 10px;
}

.countdown-number {
    font-family: var(--font-head);
    font-size: 2.6rem;
    font-weight: 400;
    color: var(--clr-accent);
    min-width: 52px;
    text-align: center;
    transition: opacity .2s;
}

.countdown-label {
    font-size: .78rem;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    letter-spacing: .1em;
}

.btn-go {
    display: inline-block;
    background: var(--clr-link);
    color: #fff;
    padding: 9px 26px;
    border-radius: var(--radius);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    letter-spacing: .03em;
    transition: background .15s;
}
.btn-go:hover { background: var(--clr-link-hover); color: #fff; text-decoration: none; }

.btn-go-disabled {
    background: var(--clr-border) !important;
    color: var(--clr-text-muted) !important;
    cursor: not-allowed !important;
    pointer-events: none;
}
.btn-go-disabled:hover {
    background: var(--clr-border) !important;
    color: var(--clr-text-muted) !important;
}

.countdown-note { font-size: .75rem; color: var(--clr-text-muted); margin-top: 6px; }

/* Progress bar (geri sayım) */
.progress-thin {
    height: 3px;
    background: var(--clr-border);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 14px;
}
.progress-thin-fill {
    height: 100%;
    background: var(--clr-link);
    width: 100%;
    transition: width 1s linear;
    border-radius: 2px;
}

/* ── Stats Grid ── */
.stats-section { margin-top: 36px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 8px;
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}
.stat-card .stat-value {
    font-family: var(--font-head);
    font-size: 1.5rem;
    color: var(--clr-text);
    line-height: 1.2;
}
.stat-card .stat-label {
    font-size: .73rem;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-top: 3px;
}

/* Detay tablolar */
.stats-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 640px) { .stats-detail-grid { grid-template-columns: 1fr; } }

.stats-block {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.stats-block-head {
    padding: 12px 16px 8px;
    font-size: .73rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--clr-text-muted);
    border-bottom: 1px solid var(--clr-border);
    background: var(--clr-accent-light);
}

.stats-list { list-style: none; padding: 0; margin: 0; max-height: 200px; overflow-y: auto; }
.stats-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 16px;
    border-bottom: 1px solid var(--clr-border);
    font-size: .83rem;
}
.stats-list li:last-child { border-bottom: none; }
.stats-list .stat-name { color: var(--clr-text); }
.stats-list .stat-count { color: var(--clr-text-muted); font-family: var(--font-mono); font-size: .78rem; }

/* Bar chart mini */
.bar-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 16px;
    border-bottom: 1px solid var(--clr-border);
}
.bar-mini:last-child { border-bottom: none; }
.bar-mini .bar-label { font-size: .82rem; min-width: 80px; color: var(--clr-text); }
.bar-mini .bar-track { flex: 1; height: 8px; background: var(--clr-tag-bg); border-radius: 4px; overflow: hidden; }
.bar-mini .bar-fill { height: 100%; background: var(--clr-link); border-radius: 4px; transition: width .4s; }
.bar-mini .bar-val { font-family: var(--font-mono); font-size: .75rem; color: var(--clr-text-muted); min-width: 32px; text-align: right; }

/* QR + Screenshot row */
.media-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}
@media (max-width: 580px) { .media-row { grid-template-columns: 1fr; } }

.media-card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.media-card .media-card-head {
    padding: 10px 16px;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--clr-text-muted);
    border-bottom: 1px solid var(--clr-border);
    background: var(--clr-accent-light);
}
.media-card .media-card-body {
    padding: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 180px;
    background: #fff;
}
.media-card img { border-radius: 4px; box-shadow: var(--shadow-sm); }
.media-card .placeholder-txt { color: var(--clr-text-muted); font-size: .8rem; font-style: italic; }

/* ── Recent URLs list ── */
.recent-section { margin-top: 48px; }

.recent-list { list-style: none; padding: 0; }
.recent-list li {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .15s;
}
.recent-list li:hover { box-shadow: var(--shadow-md); }

.recent-item-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.recent-item-title {
    font-weight: 600;
    font-size: .92rem;
    color: var(--clr-text);
}

.recent-item-title-min {
    font-weight: 400;
    font-size: .75rem;
    color: var(--clr-text);
}

.recent-item-title a { color: var(--clr-text); }
.recent-item-title a:hover { color: var(--clr-link); text-decoration: none; }

.recent-item-short {
    font-family: var(--font-mono);
    font-size: .76rem;
    color: var(--clr-link);
    white-space: nowrap;
}
.recent-item-short a { color: var(--clr-link); }

.recent-item-desc {
    margin-top: 5px;
    font-size: .82rem;
    color: var(--clr-text-muted);
    line-height: 1.45;
}

.recent-item-desc-min {
    margin-top: 5px;
    font-size: .75rem;
    color: var(--clr-text-muted);
    line-height: 1.15;
}

.recent-item-meta {
    margin-top: 8px;
    font-size: .73rem;
    color: var(--clr-text-muted);
    display: flex;
    gap: 16px;
}

/* ── Admin Panel ── */
.admin-wrap { max-width: 780px; margin: 0 auto; padding: 40px 20px 80px; }

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--clr-border);
}
.admin-header h1 { font-family: var(--font-head); font-size: 1.6rem; font-weight: 400; }
.btn-logout {
    font-size: .77rem;
    color: var(--clr-danger);
    border: 1px solid var(--clr-danger);
    padding: 5px 12px;
    border-radius: var(--radius);
    background: none;
    cursor: pointer;
    text-decoration: none;
}
.btn-logout:hover { background: var(--clr-danger); color: #fff; text-decoration: none; }

.form-card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 8px;
    padding: 28px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.form-card label {
    display: block;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--clr-text-muted);
    margin-bottom: 8px;
}

.form-card textarea,
.form-card input[type="text"],
.form-card input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: .88rem;
    background: var(--clr-bg);
    color: var(--clr-text);
    transition: border-color .15s;
}
.form-card textarea:focus,
.form-card input:focus {
    outline: none;
    border-color: var(--clr-link);
    background: #fff;
}
.form-card textarea {
    min-height: 160px;
    resize: vertical;
    font-family: var(--font-mono);
    font-size: .8rem;
    line-height: 1.7;
}

.form-hint {
    font-size: .74rem;
    color: var(--clr-text-muted);
    margin-top: 6px;
    line-height: 1.45;
}

.btn-primary {
    background: var(--clr-link);
    color: #fff;
    border: none;
    padding: 10px 28px;
    border-radius: var(--radius);
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: .03em;
    transition: background .15s;
}
.btn-primary:hover { background: var(--clr-link-hover); }
.btn-primary:disabled { background: #aaa; cursor: not-allowed; }

/* Toast / Alert */
.alert-box {
    padding: 12px 18px;
    border-radius: var(--radius);
    font-size: .83rem;
    margin-bottom: 18px;
    display: none;
}
.alert-box.show { display: block; }
.alert-success { background: #eafaf1; border: 1px solid #c3e6cb; color: #155724; }
.alert-danger  { background: #f8d7da; border: 1px solid #f5c6cb; color: #721c24; }
.alert-info    { background: #cce5ff; border: 1px solid #b8daff; color: #004085; }

/* Parse durumu listesi */
.parse-status-list { list-style: none; padding: 0; margin-top: 12px; }
.parse-status-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--clr-border);
    font-size: .82rem;
}
.parse-status-list li:last-child { border-bottom: none; }
.status-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot.pending  { background: #f39c12; }
.status-dot.done     { background: var(--clr-success); }
.status-dot.failed   { background: var(--clr-danger); }
.status-dot.processing { background: #3498db; animation: pulse .8s infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.4; } }

/* ── Login page ── */
.login-wrap {
    max-width: 380px;
    margin: 100px auto 0;
    padding: 0 20px;
}
.login-wrap .login-logo {
    font-family: var(--font-head);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 32px;
    color: var(--clr-text);
}
.login-wrap .login-logo span { color: var(--clr-link); }

/* ── Install page ── */
.install-wrap { max-width: 520px; margin: 80px auto 0; padding: 0 20px; }
.install-wrap .install-logo { font-family: var(--font-head); font-size: 1.9rem; text-align: center; margin-bottom: 8px; }
.install-wrap .install-sub { text-align: center; color: var(--clr-text-muted); font-size: .85rem; margin-bottom: 32px; }

.install-step {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.install-step h3 {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--clr-text-muted);
    margin-bottom: 14px;
}

/* ── Footer ── */
.site-footer {
    text-align: center;
    padding: 28px 20px;
    border-top: 1px solid var(--clr-border);
    margin-top: 40px;
}
.site-footer span { font-size: .75rem; color: var(--clr-text-muted); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--clr-bg); }
::-webkit-scrollbar-thumb { background: var(--clr-border); border-radius: 3px; }

/* -- Admin Aksiyon Butonları -- */
.btn-edit, .btn-delete {
    border: none;
    background: none;
    cursor: pointer;
    font-size: .75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background .15s;
    font-family: var(--font-sans);
}
.btn-edit { color: var(--clr-link); }
.btn-edit:hover { background: rgba(99,102,241,.08); }
.btn-delete { color: #c0392b; margin-left: 4px; }
.btn-delete:hover { background: rgba(192,57,43,.08); }
.btn-edit:disabled, .btn-delete:disabled { opacity: .5; cursor: default; }

/* -- Modal -- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.38);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
}
.modal-box {
    background: var(--clr-card);
    border-radius: 12px;
    width: 90%;
    max-width: 460px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 0;
}
.modal-title {
    font-weight: 600;
    font-size: .9rem;
    color: var(--clr-text);
}
.modal-close {
    border: none;
    background: none;
    font-size: 1.4rem;
    color: var(--clr-text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
}
.modal-close:hover { color: var(--clr-text); }
.modal-body {
    padding: 18px 22px 22px;
}
.modal-body label {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    color: var(--clr-text-muted);
    margin-bottom: 6px;
}
.modal-body input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid var(--clr-border);
    border-radius: 6px;
    font-size: .85rem;
    font-family: var(--font-sans);
    background: var(--clr-bg);
    color: var(--clr-text);
    outline: none;
    transition: border-color .15s;
}
.modal-body input[type="text"]:focus { border-color: var(--clr-link); }

/* -- Responsive ── */
@media (max-width: 600px) {
    .page-wrap, .page-wrap-wide { padding: 24px 16px 60px; }
    .redirect-hero { padding: 24px 18px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .site-header { padding: 0 16px; }
}

/* -- URL Table -- */
.url-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}
.url-table th {
    font-weight: 500;
    color: var(--clr-text-muted);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    text-align: left;
    padding: 0 12px 10px;
    border-bottom: 1px solid var(--clr-border);
}
.url-table .th-right { text-align: right; }
.url-table .th-actions { width: 110px; text-align: right; }
.url-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--clr-border);
    color: var(--clr-text);
}
.url-table .link-mono {
    color: var(--clr-link);
    font-family: var(--font-mono);
    font-size: .78rem;
    text-decoration: none;
}
.url-table .link-mono:hover { text-decoration: underline; }
.url-table .td-title { color: var(--clr-text); max-width: 260px; }
.url-table .td-right { text-align: right; }
.url-table .td-mono { font-family: var(--font-mono); font-size: .78rem; color: var(--clr-text-muted); }
.url-table .td-date { color: var(--clr-text-muted); font-size: .78rem; white-space: nowrap; }
.url-table .td-actions { text-align: right; white-space: nowrap; }

/* -- List Header -- */
.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.list-meta {
    font-size: .75rem;
    color: var(--clr-text-muted);
}

/* -- Pagination -- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 6px;
    border: 1px solid var(--clr-border);
    background: var(--clr-card);
    color: var(--clr-text);
    font-size: .8rem;
    font-family: var(--font-sans);
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.page-btn:hover {
    background: var(--clr-link);
    border-color: var(--clr-link);
    color: #fff;
}
.page-btn.active {
    background: var(--clr-link);
    border-color: var(--clr-link);
    color: #fff;
    font-weight: 600;
    pointer-events: none;
}
.page-btn.page-first,
.page-btn.page-last  { color: var(--clr-text-muted); }
.page-btn.page-prev,
.page-btn.page-next  { color: var(--clr-text-muted); }
.page-dots {
    color: var(--clr-text-muted);
    font-size: .8rem;
    padding: 0 2px;
}
