/* =============================================
   CrewPanel - Ana Stil Dosyası
   ============================================= */

:root {
  --bg-dark:       #0a0a0f;
  --bg-card:       #12121a;
  --bg-card2:      #1a1a26;
  --bg-hover:      #1e1e2e;
  --border:        #2a2a3e;
  --accent:        #e63946;
  --accent-hover:  #c1121f;
  --accent-glow:   rgba(230, 57, 70, 0.3);
  --gold:          #ffd60a;
  --gold-dark:     #e6b800;
  --text:          #e8e8f0;
  --text-muted:    #7878a0;
  --text-dim:      #4a4a6a;
  --success:       #2dc653;
  --warning:       #ffd60a;
  --danger:        #e63946;
  --info:          #4cc9f0;
  --discord:       #5865f2;
  --sidebar-w:     260px;
  --header-h:      64px;
  --radius:        10px;
  --radius-sm:     6px;
  --shadow:        0 4px 20px rgba(0,0,0,0.5);
  --transition:    all 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 14px;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ---- Typography ---- */
h1, h2, h3, h4, h5 { font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

.text-accent  { color: var(--accent) !important; }
.text-gold    { color: var(--gold) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-info    { color: var(--info) !important; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 0 20px var(--accent-glow); }

.btn-discord   { background: var(--discord); color: #fff; }
.btn-discord:hover { background: #4752c4; box-shadow: 0 0 20px rgba(88,101,242,0.4); }

.btn-gold      { background: var(--gold); color: #000; }
.btn-gold:hover { background: var(--gold-dark); }

.btn-outline   { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-success   { background: var(--success); color: #fff; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-sm        { padding: 5px 12px; font-size: 12px; }
.btn-lg        { padding: 13px 28px; font-size: 15px; }
.btn-icon      { padding: 8px; }

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
}
.card:hover { border-color: rgba(230,57,70,0.3); }
.card-header {
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 700; }

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-boss   { background: linear-gradient(135deg,#ffd60a,#e6b800); color: #000; }
.badge-og     { background: linear-gradient(135deg,#e63946,#c1121f); color: #fff; }
.badge-member { background: var(--bg-card2); color: var(--text-muted); border: 1px solid var(--border); }
.bg-success   { background: var(--success) !important; color: #fff; }
.bg-danger    { background: var(--danger) !important; color: #fff; }
.bg-warning   { background: var(--warning) !important; color: #000; }
.bg-info      { background: var(--info) !important; color: #000; }
.bg-secondary { background: var(--bg-card2) !important; color: var(--text-muted); border: 1px solid var(--border); }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-control::placeholder { color: var(--text-dim); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ---- Alerts ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid;
  margin-bottom: 16px;
  font-size: 13px;
}
.alert-danger  { background: rgba(230,57,70,0.1);  border-color: var(--danger);  color: #ff8a8a; }
.alert-success { background: rgba(45,198,83,0.1);   border-color: var(--success); color: #7dfa9a; }
.alert-warning { background: rgba(255,214,10,0.1);  border-color: var(--warning); color: var(--warning); }
.alert-info    { background: rgba(76,201,240,0.1);  border-color: var(--info);    color: var(--info); }

/* ---- Tables ---- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-hover); }
.table-responsive { overflow-x: auto; }

/* ---- Avatar ---- */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.avatar-sm { width: 28px; height: 28px; }
.avatar-lg { width: 56px; height: 56px; }
.avatar-xl { width: 80px; height: 80px; }

/* ---- Sidebar Layout ---- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-logo {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo img { width: 36px; height: 36px; border-radius: 8px; }
.sidebar-logo-text { font-size: 16px; font-weight: 800; letter-spacing: -0.03em; }
.sidebar-logo-crew { font-size: 11px; color: var(--text-muted); }

.sidebar-nav { padding: 12px 0; flex: 1; }
.nav-section-title {
  padding: 10px 20px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
  text-decoration: none;
}
.nav-item:hover { color: var(--text); background: var(--bg-hover); }
.nav-item.active { color: var(--accent); background: rgba(230,57,70,0.08); border-left-color: var(--accent); }
.nav-item i { font-size: 16px; width: 20px; text-align: center; }
.nav-item .badge { margin-left: auto; font-size: 10px; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-username { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-role { font-size: 11px; color: var(--text-muted); }

/* ---- Main Content ---- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 18px; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.page-content { padding: 24px; flex: 1; }

/* ---- Stat Cards ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--accent);
}
.stat-card.gold::before  { background: var(--gold); }
.stat-card.green::before { background: var(--success); }
.stat-card.blue::before  { background: var(--info); }
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-icon  { position: absolute; right: 16px; top: 16px; font-size: 28px; opacity: 0.1; }

/* ---- Leaderboard ---- */
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.leaderboard-item:last-child { border-bottom: none; }
.rank { width: 32px; text-align: center; font-size: 16px; font-weight: 800; }
.rank-1 { color: var(--gold); }
.rank-2 { color: #c0c0c0; }
.rank-3 { color: #cd7f32; }
.lb-info { flex: 1; }
.lb-name  { font-size: 14px; font-weight: 600; }
.lb-sub   { font-size: 12px; color: var(--text-muted); }
.lb-score { font-size: 18px; font-weight: 800; color: var(--accent); }

/* ---- Chat ---- */
.chat-layout { display: flex; height: calc(100vh - var(--header-h) - 48px); gap: 16px; }

.chat-sidebar {
  width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-y: auto;
  flex-shrink: 0;
}
.chat-channel {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
}
.chat-channel:hover { color: var(--text); background: var(--bg-hover); }
.chat-channel.active { color: var(--text); background: rgba(230,57,70,0.1); }
.chat-channel-prefix { color: var(--text-dim); font-weight: 700; }

.chat-main {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.message {
  display: flex;
  gap: 12px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.message:hover { background: var(--bg-hover); }
.message-avatar { flex-shrink: 0; }
.message-body { flex: 1; min-width: 0; }
.message-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.message-author { font-size: 14px; font-weight: 700; }
.message-time   { font-size: 11px; color: var(--text-dim); }
.message-content { font-size: 14px; line-height: 1.5; word-break: break-word; }

.message-type-announcement { background: rgba(255,214,10,0.05); border-left: 3px solid var(--gold); padding-left: 12px; }
.message-type-war { background: rgba(230,57,70,0.08); border-left: 3px solid var(--danger); padding-left: 12px; }
.message-type-meeting { background: rgba(45,198,83,0.05); border-left: 3px solid var(--success); padding-left: 12px; }
.message-type-system { background: transparent; border-left: 3px solid var(--text-dim); padding-left: 12px; opacity: 0.7; }

.chat-input-area { padding: 16px; border-top: 1px solid var(--border); }
.chat-input-wrap { display: flex; gap: 8px; align-items: flex-end; }
.chat-input {
  flex: 1;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  resize: none;
  max-height: 120px;
  outline: none;
  transition: var(--transition);
}
.chat-input:focus { border-color: var(--accent); }
.chat-quick-actions { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.quick-action-btn {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.quick-action-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Map ---- */
.map-container { height: 450px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
#crew-map { height: 100%; }
.leaflet-container { background: #1a1a2e; }
.map-popup { min-width: 160px; }
.map-popup h4 { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.map-popup p  { font-size: 12px; color: #aaa; margin-bottom: 0; }

/* ---- Online indicator ---- */
.online-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  box-shadow: 0 0 6px var(--success);
}
.online-dot.offline { background: var(--text-dim); box-shadow: none; }

/* ---- Modals ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: modal-in 0.2s ease;
}
@keyframes modal-in { from { opacity:0; transform: scale(0.95) translateY(10px); } to { opacity:1; transform: none; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 20px; transition: var(--transition); }
.modal-close:hover { color: var(--accent); }

/* ---- Progress ---- */
.progress { height: 6px; background: var(--bg-card2); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 3px; transition: width 0.5s ease; background: var(--accent); }
.progress-bar.gold { background: var(--gold); }
.progress-bar.green { background: var(--success); }

/* ---- Divider ---- */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- Landing ---- */
.landing { min-height: 100vh; display: flex; flex-direction: column; }
.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(230,57,70,0.15) 0%, transparent 70%),
    var(--bg-dark);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(230,57,70,0.1);
  border: 1px solid rgba(230,57,70,0.3);
  border-radius: 20px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 24px;
}
.hero h1 { font-size: 3.5rem; line-height: 1.1; margin-bottom: 16px; }
.hero h1 span { color: var(--accent); }
.hero-sub { font-size: 1.1rem; color: var(--text-muted); max-width: 520px; margin: 0 auto 36px; }
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 20px; }
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}
.feature-card:hover { border-color: rgba(230,57,70,0.4); transform: translateY(-2px); }
.feature-icon { font-size: 28px; margin-bottom: 12px; }
.feature-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.feature-desc { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 16px; }
  .hero h1 { font-size: 2.2rem; }
  .chat-layout { flex-direction: column; height: auto; }
  .chat-sidebar { width: 100%; height: auto; }
  .chat-main { height: 60vh; }
}

/* ---- Animations ---- */
@keyframes fadeIn { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: none; } }
.fade-in { animation: fadeIn 0.3s ease; }

@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }
.pulse { animation: pulse 2s infinite; }

/* ---- Notification toast ---- */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: toast-in 0.3s ease;
  min-width: 260px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--info); }
@keyframes toast-in { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: none; } }

/* ---- War/Alert Banner ---- */
.war-banner {
  background: linear-gradient(135deg, rgba(230,57,70,0.2), rgba(194,18,31,0.2));
  border: 1px solid rgba(230,57,70,0.4);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.war-banner-icon { font-size: 28px; }
.war-banner-title { font-size: 15px; font-weight: 700; color: var(--accent); }
.war-banner-sub { font-size: 12px; color: var(--text-muted); }

/* ---- Utilities ---- */
.d-flex   { display: flex; }
.d-grid   { display: grid; }
.d-none   { display: none; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-1 { flex: 1; }
.w-100 { width: 100%; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.p-3  { padding: 12px; }
.p-4  { padding: 16px; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.fw-bold { font-weight: 700; }
.fs-sm  { font-size: 12px; }
.fs-xs  { font-size: 11px; }
.rounded { border-radius: 50%; }
.cursor-pointer { cursor: pointer; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
