:root {
    --bg: #f8f5f0; --card: #ffffff; --accent: #c4622d; --text: #1a1410;
    --muted: #8a7a6a; --border: #e2d9cd; --green: #2d6a4f; --green-bg: #d8f3dc; --red: #e63946;
    --gap: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; -webkit-tap-highlight-color: transparent; }

body { background: var(--bg); color: var(--text); font-family: 'DM Sans', sans-serif; overflow-x: hidden; padding-bottom: 0; display: flex; flex-direction: column; min-height: 100vh; }

nav { padding: 1rem clamp(1rem, 5vw, 4rem); background: var(--card); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 100; }
.logo { font-family: 'Playfair Display', serif; font-size: clamp(1.2rem, 4vw, 1.4rem); font-weight: 700; }
.logo span { color: var(--accent); }

.status-badge { font-family: 'DM Mono', monospace; font-size: 0.6rem; border: 1px solid var(--border); padding: 0.4rem 0.8rem; border-radius: 999px; display: none; align-items: center; gap: 5px; transition: 0.3s; white-space: nowrap; }
.status-online { color: var(--green); background: var(--green-bg); }
.status-syncing { color: var(--accent); background: #fff3e0; }
.status-offline { color: var(--muted); background: #f5f5f5; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.btn-auth { background: var(--text); color: #fff; border: none; padding: 0.6rem 1rem; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 0.75rem; transition: 0.3s; white-space: nowrap; }

.hero { padding: clamp(1.5rem, 5vw, 3rem) 1rem; text-align: center; background: var(--card); border-bottom: 1px solid var(--border); }
.hero-title { font-family: 'Playfair Display', serif; font-size: clamp(1.5rem, 6vw, 2.2rem); margin-bottom: 0.5rem; transition: 0.3s; line-height: 1.2; }

.cd-grid { display: flex; justify-content: center; gap: clamp(0.3rem, 2vw, 0.5rem); margin-top: 1rem; transition: 0.3s; flex-wrap: wrap; }
.cd-box { background: var(--text); color: #fff; padding: clamp(0.5rem, 2vw, 0.7rem); border-radius: 10px; min-width: clamp(55px, 15vw, 65px); flex: 1 1 auto; max-width: 80px; }
.cd-num { font-family: 'DM Mono', monospace; font-size: clamp(1.2rem, 4vw, 1.4rem); display: block; }
.cd-lab { font-size: 0.5rem; opacity: 0.6; text-transform: uppercase; }

#welcomeText { display: none; margin-top: 1rem; font-size: clamp(0.85rem, 3vw, 0.95rem); line-height: 1.6; color: var(--muted); max-width: 600px; margin-left: auto; margin-right: auto; padding: 0 1rem; animation: fadeIn 0.5s ease-out; }

.container { padding: clamp(1rem, 3vw, 1.5rem); max-width: 800px; margin: 0 auto; flex: 1; width: 100%; }

#visitorShowcase { display: none; text-align: center; animation: fadeIn 0.5s ease-out; margin-top: 1rem; }
.btn-cta { background: var(--accent); color: #fff; border: none; border-radius: 16px; font-size: clamp(0.95rem, 3vw, 1.1rem); font-weight: 700; padding: 1.2rem clamp(1.5rem, 4vw, 2rem); cursor: pointer; transition: 0.3s; box-shadow: 0 10px 25px rgba(196, 98, 45, 0.3); margin-bottom: 3rem; display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: 400px; }
.btn-cta:hover { transform: translateY(-3px); box-shadow: 0 15px 30px rgba(196, 98, 45, 0.4); }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1rem; margin-bottom: 3rem; text-align: left; }
.feature-box { background: var(--card); padding: clamp(1.2rem, 4vw, 1.5rem); border-radius: 16px; border: 1px solid var(--border); transition: 0.3s; }
.feature-box:hover { border-color: var(--accent); transform: translateY(-3px); }
.feature-icon { font-size: 2rem; margin-bottom: 10px; }
.feature-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.feature-desc { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }

.mockup-section { text-align: left; opacity: 0.8; transform: scale(0.95); pointer-events: none; user-select: none; border: 2px dashed var(--border); border-radius: 20px; padding: 10px; background: rgba(255,255,255,0.5); overflow: hidden; }

/* MOBİL İÇİN KRİTİK: Font-size 16px olmazsa iOS Safari otomatik Zoom yapar ve düzeni bozar! */
.input-box { padding: 1rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); font-family: inherit; font-size: 16px !important; width: 100%; transition: 0.3s; box-sizing: border-box; margin-bottom: var(--gap); }
.input-box:focus { border-color: var(--accent); background: #fff; }

.flex-row { display: flex; gap: var(--gap); align-items: center; flex-wrap: wrap; }
.flex-row > * { flex: 1 1 auto; }

.btn-main { padding: 1rem; border: none; border-radius: 12px; cursor: pointer; font-weight: 700; font-size: 1rem; width: 100%; transition: 0.3s; text-align: center; }
.btn-primary { background: var(--text); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-cancel { background: #e2d9cd; color: var(--text); }
.btn-mini { background: #f8f5f0; border: 1px solid var(--border); padding: 10px clamp(5px, 2vw, 10px); border-radius: 10px; cursor: pointer; font-size: 0.8rem; font-weight: 700; flex: 1 1 auto; text-align: center; color: var(--text); white-space: nowrap; min-width: 80px; }
.btn-main:disabled, .btn-mini:disabled { opacity: 0.6; cursor: not-allowed; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: clamp(1rem, 3vw, 1.2rem); transition: 0.3s; overflow: hidden; margin-bottom: 1rem; }
.card-header { display: flex; align-items: flex-start !important; justify-content: space-between; cursor: pointer; gap: 10px; }
.card-header > div:first-child { flex: 1; min-width: 0; } /* Uzun başlıkların ekranı patlatmasını engeller */
.toggle-icon { flex-shrink: 0; margin-top: 5px; font-size: 0.9rem; transition: transform 0.3s; }
.toggle-icon.open { transform: rotate(180deg); }
.card-body { display: none; margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.card-body.open { display: block; animation: slideDown 0.3s ease-out; }

@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { 0% { transform: scale(0.97); opacity: 0.7; } 100% { transform: scale(1); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* FLATPICKR MOBİL DÜZELTMESİ */
.flatpickr-calendar.inline { width: 100% !important; max-width: 100% !important; border: 1px solid var(--border) !important; background: var(--bg) !important; border-radius: 12px !important; box-shadow: none !important; margin: 10px 0 25px 0 !important; display: flex !important; flex-direction: column !important; align-items: center !important; padding: 10px 0 !important; box-sizing: border-box !important; overflow: hidden; }
.flatpickr-months, .flatpickr-innerContainer { width: 100% !important; max-width: 100% !important; }
.flatpickr-days { width: 100% !important; }
.dayContainer { width: 100% !important; min-width: 100% !important; max-width: 100% !important; }

.widget-panel { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; overflow-wrap: anywhere; }
.weather-info { font-family: 'DM Mono', monospace; font-size: 0.85rem; color: var(--text); line-height: 1.5; }
.weather-info strong { color: var(--accent); }
.exchange-info { font-family: 'DM Mono', monospace; font-size: 0.85rem; color: var(--green); margin-top: 6px; font-weight: 700; display: block; }
.budget-header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px; font-size: 0.85rem; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.budget-bar-bg { height: 8px; background: #e2d9cd; border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.budget-bar-fill { height: 100%; background: var(--green); width: 0%; transition: width 0.6s ease; }

.checklist { display: grid; gap: 0.5rem; }
.todo-item { display: flex; align-items: center; padding: 0.7rem; border-radius: 10px; background: var(--bg); font-size: 0.85rem; cursor: pointer; border: 1px solid transparent; position: relative;}
.todo-item.done { opacity: 0.5; text-decoration: line-through; }
.todo-item input[type="checkbox"] { pointer-events: none; margin-right: 0.6rem; flex-shrink: 0; } 
.todo-text { flex: 1; padding-right: 35px; word-wrap: break-word; line-height: 1.4; } 
.btn-del-todo { background: none; border: none; color: var(--red); font-size: 1.1rem; cursor: pointer; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); opacity: 0.6; font-weight: bold; padding: 5px; }

.expense-list { margin-top: 15px; border-top: 1px dashed var(--border); padding-top: 10px; max-height: 200px; overflow-y: auto; }
.exp-item { display: flex; justify-content: space-between; font-size: 0.8rem; padding: 8px 0; border-bottom: 1px solid #f0ebe1; color: var(--muted); gap: 10px; align-items: flex-start; }
.exp-item span:first-child { flex: 1; word-wrap: break-word; min-width: 0; line-height: 1.4; }
.exp-item span:last-child { white-space: nowrap; flex-shrink: 0; display: flex; align-items: center; }
.exp-item strong { color: var(--text); }
.exp-item .exp-del { color: var(--red); cursor: pointer; margin-left: 10px; font-weight: bold; opacity: 0.5; padding: 2px 5px; }

.btn-add-smart { width:100%; text-align:center; padding:12px; margin-top:8px; border: 1px dashed var(--accent); color: var(--accent); background:transparent; font-weight: 700; cursor: pointer; border-radius: 10px; transition: 0.3s; }
.btn-add-smart:active { background: rgba(196, 98, 45, 0.1); }

.btn-toggle-form { background: var(--card); border: 1px solid var(--border); color: var(--text); border-radius: 16px; display: none; justify-content: space-between; align-items: center; font-size: clamp(1rem, 4vw, 1.1rem); padding: 1.2rem clamp(1rem, 4vw, 1.5rem); margin-bottom: 1.5rem; width: 100%; cursor: pointer; }
.form-container { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: clamp(1rem, 4vw, 1.5rem); margin-bottom: 2rem; display: none; flex-direction: column; gap: 1.2rem; }

/* Mobilde butonlar taşmasın diye flex-wrap eklendi */
.card-bottom-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(26, 20, 16, 0.6); backdrop-filter: blur(4px); display: none; justify-content: center; align-items: center; z-index: 1000; padding: 15px; }
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease-out; }
.modal-card { background: var(--card); padding: clamp(1.5rem, 5vw, 2.5rem) clamp(1rem, 5vw, 2rem); border-radius: 24px; width: 100%; max-width: 400px; position: relative; max-height: 90vh; overflow-y: auto; }
.modal-close { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 1.2rem; color: var(--muted); cursor: pointer; padding: 5px; }

.footer { background: var(--card); border-top: 1px solid var(--border); padding: 2rem 1rem; text-align: center; margin-top: auto; }
.footer-motto { font-family: 'Playfair Display', serif; font-size: 1.1rem; color: var(--text); margin-bottom: 1rem; font-style: italic; }
.footer-links { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px 15px; margin-bottom: 1rem; font-size: 0.9rem; }
.footer-links a { color: var(--accent); text-decoration: none; font-weight: 700; transition: 0.3s; padding: 5px; }
.footer-links a:hover { color: var(--text); }
.footer-links span { color: var(--muted); opacity: 0.5; display: none; }
@media (min-width: 480px) { .footer-links span { display: inline; } }
.footer-copy { font-family: 'DM Mono', monospace; font-size: 0.75rem; color: var(--muted); line-height: 1.5; }

/* Profil Avatar Stilleri */
.nav-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); transition: 0.3s; flex-shrink: 0; }
.nav-avatar:hover { border-color: var(--accent); transform: scale(1.05); }

/* Rota Oluşturucu Stilleri */
.route-item { display: flex; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; transition: 0.2s; margin-bottom: 4px; overflow: hidden; }
.route-item.dragging { opacity: 0.5; border-color: var(--accent); background: var(--bg); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.drag-handle { color: var(--muted); cursor: grab; font-size: 1.2rem; margin-right: 10px; padding: 5px; user-select: none; touch-action: none; flex-shrink: 0; }
.drag-handle:active { cursor: grabbing; }
.route-input { flex: 1; border: none; outline: none; font-family: inherit; font-size: 16px !important; background: transparent; padding: 5px 0; min-width: 0; }
.btn-del-route { background: none; border: none; color: var(--red); font-size: 1.1rem; cursor: pointer; padding: 5px 10px; margin-left: 5px; flex-shrink: 0; }

/* --- ARKADAŞ LİSTESİ VE CANLI YEŞİL NOKTA TASARIMI --- */
.friends-list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-width: 300px; /* Kenar çubuğu genişliği */
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    transition: 0.2s;
    cursor: pointer;
}

.friend-item:hover {
    background: var(--bg);
}

.friend-avatar-wrapper {
    position: relative;
    display: flex;
}

.friend-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

/* Yeşil Nokta (Varsayılan olarak gizli) */
.status-dot {
    position: absolute;
    bottom: 0px;
    right: -2px;
    width: 14px;
    height: 14px;
    background-color: #23a559; /* Discord Yeşili */
    border: 2.5px solid var(--card); /* Resme karışmasın diye kalın çerçeve */
    border-radius: 50%;
    display: none; 
    transition: 0.3s;
}

/* Javascript 'online' klasını eklediğinde nokta görünür olur */
.status-dot.online {
    display: block;
}

.friend-name {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    color: var(--text);
    font-size: 0.95rem;
}