:root {
    --bg: #050505; --text: #f5f5f5; --card-bg: #0f0f0f; --border: #2a2a2a; 
    --primary-btn: #fff; --primary-btn-text: #000; --sec-btn: #1c1c1e; 
    --sec-btn-hover: #2a2a2a; --header-bg: #050505; --accent: #4facfe; --muted: #aaa;
}
[data-theme="light"] {
    --bg: #f2f2f7; --text: #1c1c1e; --card-bg: #ffffff; --border: #d1d1d6; 
    --primary-btn: #000; --primary-btn-text: #fff; --sec-btn: #e5e5ea; 
    --sec-btn-hover: #d1d1d6; --header-bg: #ffffff; --accent: #007aff; --muted: #666;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
body { background-color: var(--bg); color: var(--text); display: flex; flex-direction: column; min-height: 100vh; transition: background-color 0.3s; }

/* HEADER & MENÜ */
.app-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background-color: var(--header-bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; transition: 0.3s; }
.logo { font-size: 20px; font-weight: 700; color: var(--text); text-decoration: none; }
.header-actions { display: flex; gap: 10px; align-items: center; }

.menu-overlay { position: fixed; top: 0; right: -100%; width: 100%; max-width: 300px; height: 100%; background: var(--card-bg); z-index: 100; padding: 20px; transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1); border-left: 1px solid var(--border); box-shadow: -10px 0 20px rgba(0,0,0,0.3); }
.menu-overlay.active { right: 0; }
.menu-close { font-size: 24px; cursor: pointer; text-align: right; margin-bottom: 20px; color: var(--text); }
.menu-item { display: block; padding: 15px 0; color: var(--text); text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--border); }
.menu-item:hover { color: var(--accent); }
.menu-row { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--border); }

/* BUTONLAR */
.btn { transition: all 0.2s; cursor: pointer; border: none; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: scale(0.96); }
.icon-btn { background: var(--sec-btn); color: var(--text); border-radius: 8px; width: 36px; height: 36px; font-size: 14px; }
.icon-btn:hover { background: var(--sec-btn-hover); }
.header-new-btn { background-color: var(--sec-btn); color: var(--text); border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.header-new-btn:hover { background-color: var(--sec-btn-hover); }
.btn-primary { width: 100%; background-color: var(--primary-btn); color: var(--primary-btn-text); border-radius: 10px; padding: 16px; font-size: 16px; transition: 0.3s; }
.btn-secondary { width: 100%; background-color: var(--sec-btn); color: var(--text); border-radius: 12px; padding: 16px; font-size: 16px; margin-bottom: 12px; }
.btn-secondary:hover { background-color: var(--sec-btn-hover); }

/* FORM ELEMANLARI */
.main-wrapper { flex: 1; display: flex; justify-content: center; padding: 20px; }
.container { width: 100%; max-width: 500px; animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

textarea { width: 100%; height: 260px; background-color: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 16px; color: var(--text); font-size: 15px; resize: none; margin-bottom: 24px; transition: 0.3s; }
textarea:focus { outline: none; border-color: var(--muted); }
label.section-title { display: block; font-size: 14px; font-weight: 500; margin-bottom: 10px; color: var(--muted); text-transform: uppercase; }

.input-wrapper { position: relative; margin-bottom: 24px; }
.input-wrapper input { width: 100%; background-color: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; color: var(--text); font-size: 15px; transition: 0.3s; outline: none; }
.input-icons { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); display: flex; gap: 14px; color: var(--muted); }
.input-icons svg { width: 20px; height: 20px; cursor: pointer; }

/* SEÇİMLER (SÜRE & TOGGLE) */
.segmented-control { display: flex; background-color: var(--sec-btn); border-radius: 10px; padding: 4px; margin-bottom: 28px; transition: 0.3s; }
.segment-btn { flex: 1; background: transparent; color: var(--muted); padding: 12px 0; font-size: 14px; border-radius: 8px; }
.segment-btn.active { background-color: var(--bg); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.toggle-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; background: var(--card-bg); padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border); transition: 0.3s; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--muted); border-radius: 24px; transition: .3s; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 2px; bottom: 2px; background-color: var(--bg); border-radius: 50%; transition: .3s; }
input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(20px); background-color: #fff; }

/* GEÇMİŞ (HISTORY) */
.history-wrapper { margin-top: 40px; border-top: 1px solid var(--border); padding-top: 30px; display: none; }
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.history-title { font-size: 16px; font-weight: 600; color: var(--text); }
.btn-text { background: none; border: none; color: var(--muted); font-size: 13px; cursor: pointer; }
.btn-danger-text { background: none; border: none; color: #ff3b30; font-size: 13px; cursor: pointer; }
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px; display: flex; justify-content: space-between; align-items: center; }
.history-date { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.history-link { font-size: 14px; color: var(--accent); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.history-actions { display: flex; gap: 6px; }

/* DİĞER (BAŞARI EKRANI, VIEW EKRANI) */
.success-icon { width: 56px; height: 56px; border: 2px solid var(--text); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px auto; }
.success-icon svg { width: 28px; height: 28px; stroke: var(--text); stroke-width: 3; fill: none; }
.success-title { font-size: 24px; font-weight: 700; margin-bottom: 12px; text-align: center; }
.success-desc { font-size: 15px; color: var(--muted); margin-bottom: 30px; line-height: 1.5; text-align: center; }
.qr-card { background-color: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-top: 30px; }
.qr-code-wrapper { background: #fff; padding: 20px; border-radius: 12px; text-align: center; margin-bottom: 20px; }
.qr-code-wrapper canvas { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.qr-actions { display: flex; gap: 10px; }
.btn-qr { flex: 1; background-color: var(--sec-btn); color: var(--text); border-radius: 10px; padding: 14px; font-size: 14px; }
.page-title { font-size: 22px; font-weight: 600; margin-bottom: 20px; color: var(--text); }
.note-box { width: 100%; min-height: 200px; max-height: 60vh; overflow-y: auto; background-color: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 20px; font-size: 16px; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; margin-bottom: 15px; }
.warning-text { font-size: 14px; color: var(--muted); margin-bottom: 25px; display: flex; align-items: center; gap: 8px; }
.warning-text svg { width: 18px; height: 18px; fill: var(--muted); }
.action-row { display: flex; gap: 10px; margin-top: 10px; }
.app-footer { text-align: center; padding: 24px 20px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); }
