/* Global theme */
:root {
	--bg: #f6f7fb;
	--card-bg: #ffffff;
	--text: #111827;
	--muted: #6b7280;
	--border: #e5e7eb;
	--primary: #4f46e5;
	--primary-600: #4338ca;
	--primary-50: #eef2ff;
	--accent: #0ea5e9;
	--warning: #d97706;
	--danger: #b91c1c;
	
	/* Novakid-inspired pastel palette */
	--sky: #7dd3fc;
	--sky-200: #bae6fd;
	--mint: #a7f3d0;
	--mint-200: #bbf7d0;
	--orange: #fb923c;
	--orange-200: #fdba74;
	--yellow: #fde68a;
	--yellow-200: #fef3c7;
	--bg-top: #f3f9ff;
	--bg-bottom: #ffffff;
}

html, body { height: 100%; }
body {
	font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
	background:
		radial-gradient(800px 420px at 8% -10%, rgba(253,230,138,.45), transparent 60%),
		radial-gradient(900px 520px at 105% -10%, rgba(125,211,252,.35), transparent 60%),
		radial-gradient(700px 480px at -5% 110%, rgba(167,243,208,.35), transparent 60%),
		radial-gradient(640px 420px at 110% 120%, rgba(251,146,60,.25), transparent 60%),
		linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
	background-repeat: no-repeat;
	color: var(--text);
}

.container { max-width: 960px; margin: 80px auto 40px; padding: 0 12px; }

/* Topbar */
.topbar {
	position: fixed; top: 0; left: 0; right: 0; height: 64px;
	display: flex; align-items: center; justify-content: center;
	background: rgba(255,255,255,.9);
	backdrop-filter: saturate(180%) blur(10px);
	border-bottom: 1px solid var(--border);
	box-shadow: 0 12px 30px rgba(2,6,23,.06);
	z-index: 10;
}
.topbar-inner {
	max-width: 960px;
	width: 100%;
	display: flex; align-items: center; justify-content: space-between;
	padding: 0;
	margin: 0 auto;
	box-sizing: border-box;
}
.topbar .center { display: flex; gap: 12px; align-items: center; }
.top-left { 
	display: flex; 
	align-items: center; 
	gap: 16px; 
	padding-left: 12px;
}
.top-right { 
	display: flex; 
	align-items: center; 
	gap: 12px; 
	padding-right: 12px;
	justify-content: flex-end;
	position: relative;
}
.topbar-logo { height: 40px; width: auto; }

/* Buttons */
.topbtn {
	border: 1px solid var(--border);
	background: #fff;
	padding: 8px 12px;
	border-radius: 16px;
	cursor: pointer;
	font-weight: 800;
	color: var(--text);
	transition: all .15s ease;
	text-decoration: none;
}
.topbtn:hover { background: var(--yellow-200); border-color: #fde68a; }
.topbtn.active { background: #e0f2fe; border-color: #7dd3fc; color: #0c4a6e; }
.logout { border-color: #fecaca; color: var(--danger); }
.logout:hover { background: #fee2e2; }
/* Make global quiz CTA non-bold */
#test-cta-global .topbtn { font-weight: 400; color: #7f1d1d; padding: 4px 12px; }
/* Restore default colors for category buttons */
#q-kararsiz, #q-bilemedim, #btn-kararsiz, #btn-bilemedim { color: inherit; }

.btn { background: var(--primary); color: #fff; border: none; border-radius: 16px; padding: 12px 18px; cursor: pointer; font-weight: 900; letter-spacing: .2px; box-shadow: 0 10px 20px rgba(2,132,199,.18); transition: transform .06s ease, background .15s ease; }
.btn:hover { background: var(--primary-600); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #475569; }
.btn.warn { background: var(--orange); }
.btn.warn:hover { background: #ea580c; }
.btn.ghost { color: #0369a1; border: 1px solid var(--sky-200); background: #fff; }
.btn:disabled { opacity: .6; cursor: default; box-shadow: none; }
/* Trainer action button colors */
#btn-know { background: #22c55e; }
#btn-know:hover { background: #16a34a; }
#btn-dont { background: #fecaca; color: #7f1d1d; }
#btn-dont:hover { background: #fca5a5; }

/* Cards */
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 20px; padding: 22px; box-shadow: 0 24px 48px rgba(2,6,23,.08); }
.h1 { font-size: 24px; font-weight: 900; margin: 0 0 12px; }
.h2 { font-size: 18px; font-weight: 800; margin: 16px 0 8px; }
/* Test header title slightly smaller */
#test-header-title { font-size: 14px; }
.small { color: var(--muted); font-size: 13px; }
.alert { background:#fef2f2; border-color:#fecaca; color:#7f1d1d; }
.success { background:#ecfdf5; border-color:#a7f3d0; color:#065f46; }

/* Lists */
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 12px 10px; border-bottom: 1px dashed var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.list li .word-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
/* Toplam Kelime listesinde tıklanan kelimenin detaylarının altta görünmesi */
.list li.word-item { display: block; }
.list li .word-title { font-weight: 700; font-size: clamp(13px, 2.8vw, 16px); line-height: 1.35; }
.list li .word-details { display: none; padding: 8px 2px 2px; color: var(--muted); font-size: clamp(12px, 2.6vw, 14px); line-height: 1.35; }
.list li .word-details .h2 { font-size: clamp(12px, 2.6vw, 14px); margin: 8px 0 4px; font-weight: 800; color: #475569; }
/* Ensure wrong-list items stack vertically (details under the word) */
#wrong-list li { display: block; }
#wrong-list .word-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#wrong-list .word-details { display: none; padding-top: 8px; }
/* Category list items also stack vertically like wrong-list */
#category-list li { display: block; }
#category-list .word-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#category-list .word-details { display: none; padding-top: 8px; }
#category-list .row-actions { white-space: nowrap; flex-wrap: nowrap; }
#category-list .row-actions .link-remove { white-space: nowrap; }
#category-list .row-actions .sep { margin: 0 1ch; }
@media (max-width: 420px) {
	#category-list .row-actions .sep { margin: 0 1.2ch; }
}

/* Inputs */
.input, textarea.input { width: 100%; padding: 12px 14px; border: 1px solid #cbd5e1; border-radius: 14px; outline: none; transition: border-color .15s ease, box-shadow .15s ease; background: #fff; }
.input:focus, textarea.input:focus { border-color: var(--sky-200); box-shadow: 0 0 0 3px rgba(125,211,252,.35); }
/* Auth inputs 10% narrower */
#auth .input { width: 90%; margin-left: auto; margin-right: auto; margin-bottom: 12px; }

.badge { background: #fef3c7; color: #92400e; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 900; }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.col-6 { grid-column: span 6; }
.col-12 { grid-column: span 12; }
@media (max-width: 900px) { .col-6 { grid-column: span 12; } }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(2,6,23,.45); display: none; align-items: center; justify-content: center; z-index: 50; }
.modal .panel { background: #fff; width: min(720px, 92vw); max-height: 80vh; overflow: auto; border-radius: 20px; padding: 16px; box-shadow: 0 40px 80px rgba(2,6,23,.25); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.rank { width: 36px; text-align: right; padding-right: 10px; }

/* Mobile menu */
#mobile-menu-btn { display: none; position: absolute; right: 12px; }
#mobile-menu { position: absolute; right: 8px; top: 56px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 8px; box-shadow: 0 16px 40px rgba(0,0,0,.12); display: none; z-index: 50; }
#mobile-menu .item { display: block; margin: 6px 0; }

/* Remove link as plain text (no box), burgundy color */
.link-remove { background: none; border: none; padding: 0; color: #7f1d1d; text-decoration: none; font-weight: 700; cursor: pointer; }
.link-remove:hover { color: #991b1b; }
/* Text action link (no button chrome) */
.link-action { background: none; border: none; padding: 0; color: #0284c7; font-weight: 500; text-decoration: none; }
.link-action:hover { color: #0369a1; }
/* Search input responsive */
#search-wrap .input { max-width: 100%; box-sizing: border-box; font-size: clamp(12px, 3.5vw, 16px); padding: clamp(8px, 2.6vw, 12px); }
@media (max-width: 420px) {
	#search-wrap { margin: 6px 0 6px; }
	#search-wrap .input { font-size: 12px; padding: 8px 10px; }
}
@media (max-width: 640px) {
	.topbar .center { overflow-x: auto; white-space: nowrap; padding: 0 12px; }
	.top-right { display: flex; }
	#mobile-menu-btn { display: inline-flex; }
	.container { padding: 0 12px; }
	.topbar-inner { padding: 0 12px; }
}

/* Trainer headline hidden already; ensure spacing */
#trainer #current-word { font-size: 32px; font-weight: 900; letter-spacing: .3px; }
/* Center trainer and responsive buttons */
#trainer { display: flex; flex-direction: column; align-items: center; }
#action-buttons { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: nowrap; }
#action-buttons .btn { white-space: nowrap; font-size: clamp(9px, 2.6vw, 15px); padding: clamp(5px, 1.8vw, 10px) clamp(8px, 3vw, 14px); }
@media (max-width: 420px) {
	#action-buttons { gap: 8px; }
	#action-buttons .btn { font-size: 10px; padding: 6px 10px; }
}
@media (max-width: 360px) {
	#action-buttons .btn { font-size: 9px; padding: 5px 8px; }
	#action-buttons { gap: 6px; }
}
/* Quick categories card */
#quick-cats { display: flex; flex-direction: column; align-items: center; }
#quick-cats .line { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: nowrap; }
#quick-cats .topbtn { white-space: nowrap; font-weight: 600; font-size: 0.875rem; padding: 5px 9px; margin: 0; }
#quick-cats .badge { font-size: 12px; padding: 1px 8px; }
@media (max-width: 420px) {
	#quick-cats { padding: 6px 4px; }
	#quick-cats .line { gap: 4px; flex-wrap: wrap; }
	#quick-cats .topbtn { font-size: 10px; padding: 5px 6px; font-weight: 600; }
	#quick-cats .badge { font-size: 10px; padding: 1px 5px; }
}

/* Hamburger Menu */
.hamburger-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	justify-content: center;
	align-items: center;
	width: 32px;
	height: 32px;
}
.hamburger-btn span {
	width: 20px;
	height: 2px;
	background: #1e3a8a;
	border-radius: 2px;
	transition: all 0.3s ease;
}
.dark-mode .hamburger-btn span {
	background: #e5e7eb;
}

/* Dark Mode Button */
.dark-mode-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	transition: background 0.15s ease;
}
.dark-mode-btn:hover {
	background: rgba(0,0,0,0.05);
}
.dark-mode .dark-mode-btn:hover {
	background: rgba(255,255,255,0.1);
}
.dark-mode-btn svg {
	width: 20px;
	height: 20px;
	color: #1e3a8a;
	display: block;
}
.dark-mode .dark-mode-btn svg {
	color: #e5e7eb;
}

/* Dropdown Menu */
.menu-wrapper {
	position: relative;
}
.dropdown-menu {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	background: var(--card-bg);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 8px;
	box-shadow: 0 16px 40px rgba(0,0,0,.12);
	display: none;
	z-index: 50;
	min-width: 200px;
	white-space: nowrap;
}
.dropdown-menu.show {
	display: block;
}
.dropdown-menu-item {
	display: block;
	padding: 10px 14px;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 600;
	color: var(--text);
	text-decoration: none;
	transition: background 0.15s ease;
	margin: 2px 0;
}
.dropdown-menu-item:hover {
	background: var(--primary-50);
}
.dropdown-menu-item.logout {
	color: var(--danger);
	border-color: #fecaca;
}
.dropdown-menu-item.logout:hover {
	background: #fee2e2;
}

/* Dark Mode Styles */
body.dark-mode {
	--bg: #0f172a;
	--card-bg: #1e293b;
	--text: #f1f5f9;
	--muted: #94a3b8;
	--border: #334155;
	--primary: #6366f1;
	--primary-600: #4f46e5;
	--primary-50: #312e81;
	--accent: #0ea5e9;
	--warning: #f59e0b;
	--danger: #ef4444;
}
body.dark-mode {
	background: radial-gradient(1200px 600px at 20% -10%, #1e293b 0%, transparent 50%),
		radial-gradient(1000px 500px at 120% -20%, #0f172a 0%, transparent 50%),
		var(--bg);
}
body.dark-mode .topbar {
	background: rgba(30,41,59,.8);
	border-bottom-color: var(--border);
}
body.dark-mode .card {
	background: var(--card-bg);
	border-color: var(--border);
}
body.dark-mode .topbtn {
	background: #0f172a;
	border-color: var(--border);
	color: var(--text);
}
body.dark-mode .topbtn:hover {
	background: var(--primary-50);
	color: var(--text);
}
/* Dark mode için özel buton stilleri - orta gri arka plan, siyah font */
body.dark-mode #q-biliyorum,
body.dark-mode #q-kararsiz,
body.dark-mode #q-bilemedim,
body.dark-mode #q-toplam,
body.dark-mode #q-gormedigim {
	background: #64748b;
	border-color: #64748b;
	color: #000000;
}
body.dark-mode #q-biliyorum:hover,
body.dark-mode #q-kararsiz:hover,
body.dark-mode #q-bilemedim:hover,
body.dark-mode #q-toplam:hover,
body.dark-mode #q-gormedigim:hover {
	background: #475569;
	border-color: #475569;
	color: #000000;
}
body.dark-mode #q-biliyorum .badge,
body.dark-mode #q-kararsiz .badge,
body.dark-mode #q-bilemedim .badge,
body.dark-mode #q-toplam .badge,
body.dark-mode #q-gormedigim .badge {
	background: rgba(0, 0, 0, 0.2);
	color: #000000;
}
body.dark-mode .input {
	background: #0f172a;
	border-color: var(--border);
	color: var(--text);
}
body.dark-mode .input::placeholder {
	color: var(--muted);
}
body.dark-mode .input:focus {
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
body.dark-mode .modal .panel {
	background: var(--card-bg);
	color: var(--text);
}
body.dark-mode .table th,
body.dark-mode .table td {
	border-bottom-color: var(--border);
}
/* Leaderboard user row highlighting */
#leader-table tbody tr.leaderboard-user-row {
	background-color: #e5e7eb !important;
	font-weight: 500;
}
body.dark-mode #leader-table tbody tr.leaderboard-user-row {
	background-color: #475569 !important;
	color: var(--text);
}
	color: var(--text);
}
body.dark-mode .dropdown-menu {
	background: var(--card-bg);
	border-color: var(--border);
}
body.dark-mode .topbar-inner {
	/* Ensure inner container is visible */
}
body.dark-mode .dropdown-menu-item {
	color: var(--text);
}
body.dark-mode .dropdown-menu-item:hover {
	background: var(--primary-50);
}
body.dark-mode .dropdown-menu-item.logout {
	background: #64748b;
	color: #000000;
}
body.dark-mode .dropdown-menu-item.logout:hover {
	background: #475569;
	color: #000000;
}
body.dark-mode .hamburger-btn span {
	background: #e5e7eb;
}
body.dark-mode .dark-mode-btn svg {
	color: #e5e7eb;
}
body.dark-mode .btn.ghost {
	background: #0f172a;
	color: var(--primary);
	border-color: var(--border);
}
body.dark-mode .btn.ghost:hover {
	background: var(--primary-50);
	color: var(--text);
}
body.dark-mode .badge {
	background: var(--primary-50);
	color: var(--text);
}
body.dark-mode .small {
	color: var(--muted);
}
body.dark-mode .h1,
body.dark-mode .h2 {
	color: var(--text);
}
body.dark-mode .list li {
	border-bottom-color: var(--border);
	color: var(--text);
}
/* About page dark mode */
body.dark-mode .card img {
	border-color: var(--border);
}
body.dark-mode .card p strong {
	color: var(--primary);
}

/* Test Cards Grid */
.test-cards-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 5px;
	margin: 0px 0;
}
.test-card {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 20px;
	background: var(--card-bg);
	border: 2px solid var(--border);
	border-radius: 16px;
	text-decoration: none;
	color: var(--text);
	transition: all 0.3s ease;
	box-shadow: 0 4px 12px rgba(0,0,0,.08);
	position: relative;
	overflow: hidden;
}
.test-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 4px;
	height: 100%;
	transition: width 0.3s ease;
}
.test-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 24px rgba(0,0,0,.12);
	border-color: transparent;
}
.test-card:hover::before {
	width: 100%;
	opacity: 0.1;
}
.test-card-green {
	border-color: #22c55e;
}
.test-card-green::before {
	background: #22c55e;
}
.test-card-green:hover {
	background: rgba(34, 197, 94, 0.05);
	border-color: #22c55e;
}
.test-card-orange {
	border-color: #fb923c;
}
.test-card-orange::before {
	background: #fb923c;
}
.test-card-orange:hover {
	background: rgba(251, 146, 60, 0.05);
	border-color: #fb923c;
}
.test-card-blue {
	border-color: #3b82f6;
}
.test-card-blue::before {
	background: #3b82f6;
}
.test-card-blue:hover {
	background: rgba(59, 130, 246, 0.05);
	border-color: #3b82f6;
}
.test-card-icon {
	font-size: 32px;
	width: 56px;
	height: 56px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	flex-shrink: 0;
	font-weight: 900;
}
.test-card-green .test-card-icon {
	background: rgba(34, 197, 94, 0.1);
	color: #16a34a;
}
.test-card-orange .test-card-icon {
	background: rgba(251, 146, 60, 0.1);
	color: #ea580c;
}
.test-card-blue .test-card-icon {
	background: rgba(59, 130, 246, 0.1);
	color: #2563eb;
}
.test-card-content {
	flex: 1;
	min-width: 0;
}
.test-card-title {
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 2px;
	color: var(--muted);
	line-height: 1.3;
}
.test-card-subtitle {
	font-size: 18px;
	font-weight: 800;
	color: var(--text);
	line-height: 1.3;
}
.test-card-arrow {
	font-size: 24px;
	color: var(--muted);
	transition: transform 0.3s ease, color 0.3s ease;
	flex-shrink: 0;
}
.test-card:hover .test-card-arrow {
	transform: translateX(4px);
	color: var(--primary);
}
@media (max-width: 640px) {
	.test-cards-grid {
		grid-template-columns: 1fr;
		gap: 5px;
	}
	.test-card {
		padding: 16px;
	}
	.test-card-icon {
		width: 48px;
		height: 48px;
		font-size: 28px;
	}
	.test-card-title {
		font-size: 12px;
	}
	.test-card-subtitle {
		font-size: 16px;
	}
}
/* Dark mode test cards */
body.dark-mode .test-card {
	background: var(--card-bg);
	border-color: var(--border);
}
body.dark-mode .test-card-green:hover {
	background: rgba(34, 197, 94, 0.15);
}
body.dark-mode .test-card-orange:hover {
	background: rgba(251, 146, 60, 0.15);
}
body.dark-mode .test-card-blue:hover {
	background: rgba(59, 130, 246, 0.15);
}
body.dark-mode .test-card-green .test-card-icon {
	background: rgba(34, 197, 94, 0.2);
	color: #4ade80;
}
body.dark-mode .test-card-orange .test-card-icon {
	background: rgba(251, 146, 60, 0.2);
	color: #fdba74;
}
body.dark-mode .test-card-blue .test-card-icon {
	background: rgba(59, 130, 246, 0.2);
	color: #60a5fa;
}


