@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
    --app-bg: #0d0406; 
    --panel-bg: #17070a; 
    --panel2-bg: #210a10;
    --text-main: #ffe6ea; 
    --text-muted: #b89199; 
    --border-color: #401722;
    --accent-color: #e84362; 
    --hover-bg: #2e1118;
    --scrollbar-bg: #0d0406; 
    --scrollbar-thumb: #e84362;
}
.theme-light {
    --app-bg: #fff0f3; 
    --panel-bg: #ffe3e8; 
    --panel2-bg: #ffccd5;
    --text-main: #590d22; 
    --text-muted: #a4133c; 
    --border-color: #ffb3c1;
    --accent-color: #c9184a; 
    --hover-bg: #ffb3c1;
}

html, body { width: 100%; height: 100%; }
* { box-sizing: border-box; font-family: 'Segoe UI', system-ui, sans-serif; margin: 0; padding: 0; outline: none; }
body { background-color: var(--app-bg); color: var(--text-main); display: flex; min-height: 100vh; height: 100vh; overflow: hidden; user-select: none; transition: background 0.3s; }
#app-hub { display: flex; width: 100%; height: 100vh !important; min-height: 100vh; align-items: stretch; }

.login-wrapper { display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; background: var(--app-bg); position: absolute; z-index: 999; }
.login-box { background: var(--panel-bg); border: 1px solid var(--border-color); padding: 40px; border-radius: 12px; width: 350px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.5); animation: popIn 0.4s ease; }
.login-input { width: 100%; padding: 12px; margin-bottom: 15px; background: var(--panel2-bg); border: 1px solid var(--border-color); color: var(--text-main); border-radius: 8px; transition: 0.3s; }

/* Kilitli Input Tasarımı */
.login-input:disabled { background: #0a0304; color: #552733; border-color: #260c13; cursor: not-allowed; opacity: 0.6; }
.theme-light .login-input:disabled { background: #eabec6; color: #885b64; border-color: #d9aeb6; }

.sidebar { width: 280px; min-width: 280px; height: 100%; background-color: var(--panel-bg); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; padding: 25px 0; z-index: 10; }
.sidebar-header { padding: 0 20px 20px 20px; border-bottom: 1px solid var(--border-color); margin-bottom: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.nav-btn { background: transparent; color: var(--text-muted); border: none; text-align: left; padding: 15px 25px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; border-left: 4px solid transparent; display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; position: relative; }
.nav-btn:hover { background-color: var(--hover-bg); color: var(--text-main); padding-left: 30px; }
.nav-btn.active { background-color: var(--panel2-bg); border-left-color: var(--accent-color); color: var(--text-main); }
.nav-btn * { pointer-events: none; }
.sidebar-footer { margin-top: auto; padding: 20px; display: flex; flex-direction: column; gap:10px; }
.voice-mini-btn { min-width: 42px; min-height: 42px; padding: 10px !important; background: var(--panel2-bg) !important; border: 1px solid var(--border-color) !important; }
.voice-page { background: var(--panel-bg); border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; }
.voice-page-header { margin: 0; padding: 14px 18px; background: var(--panel2-bg); border-bottom: 1px solid var(--border-color); }
.voice-focus-wrap { position: relative; margin: 14px; border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; background: #111; }
.voice-focus-wrap video { width: 100%; height: min(44vh, 460px); display: block; object-fit: contain; background: #111; }
.voice-focus-wrap.zoomed { position: fixed; inset: 20px; margin: 0; z-index: 9999; border: 2px solid var(--accent-color); }
.voice-focus-wrap.zoomed video { height: 100%; }
.voice-focus-name { position: absolute; right: 14px; bottom: 12px; color: rgba(255,255,255,0.85); font-size: 12px; font-weight: 400; text-shadow: 0 1px 5px rgba(0,0,0,0.95); background: none; padding: 0; }
.voice-member-grid { padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.voice-tile { position: relative; min-height: 168px; border-radius: 12px; border: 1px solid var(--border-color); background: linear-gradient(145deg, #1f0b11, #12060a); overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.voice-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.voice-avatar { width: 86px; height: 86px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.2); }
.voice-tile-label { position: absolute; right: 10px; bottom: 8px; font-size: 12px; color: rgba(255,255,255,0.85); font-weight: 400; text-shadow: 0 1px 4px rgba(0,0,0,0.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 16px); background: none; border: none; padding: 0; }
.voice-screen-tile { background: linear-gradient(145deg, #2a0e16, #1b0a10); border-style: dashed; }
.voice-screen-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #fff; font-weight: 800; font-size: 16px; letter-spacing: 0.3px; padding: 10px 14px; border: 1px solid rgba(255,255,255,0.25); border-radius: 10px; background: rgba(0,0,0,0.35); }

/* PROFİL KUTUSU */
.sidebar-profile { display:flex; align-items:center; gap:12px; padding:12px; background:var(--panel2-bg); border:1px solid var(--border-color); border-radius:8px; margin-bottom:15px; cursor:pointer; transition:0.2s; }
.sidebar-profile:hover { border-color:var(--accent-color); box-shadow: 0 0 10px rgba(232, 67, 98, 0.3); }
#sidebarAvatar { width:45px; height:45px; border-radius:50%; object-fit:cover; border:2px solid var(--border-color); background: var(--app-bg); }
.sidebar-profile-info { display:flex; flex-direction:column; gap:4px; align-items:flex-start; }

.content-area { flex-grow: 1; height: 100%; min-height: 100vh; overflow-y: auto; overflow-x: hidden; background: var(--app-bg); position: relative; scroll-behavior: smooth; }
.view { display: none; width: 100%; min-height: 100%; padding: 50px; max-width: 1400px; margin: 0 auto; }
.view.active { display: block; animation: fadeIn 0.4s; }
#view-home.active { display: flex; min-height: 100%; padding:0; max-width: none; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes glow { 0% { box-shadow: 0 0 0 transparent; border-color: transparent; } 50% { box-shadow: 0 0 15px var(--accent-color); border-color: var(--accent-color); } 100% { box-shadow: 0 0 0 transparent; border-color: transparent; } }

/* ACTION BUTONLARI (TIKLANABİLİRLİK FİX) */
button.action-btn, a.action-btn { background: var(--accent-color); color: #fff; border: none; padding: 12px 18px; border-radius: 6px; font-weight: 600; cursor: pointer; transition: 0.3s; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; gap: 8px; position: relative; box-sizing: border-box; user-select: none; }
button.action-btn *, a.action-btn * { pointer-events: none; }
button.action-btn:hover, a.action-btn:hover { filter: brightness(1.2); }
button.danger-btn { background: #e74c3c; }

.panel { background: var(--panel-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 30px; margin-bottom: 25px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; font-weight: 700; font-size: 18px; color: var(--text-main); border-bottom: 1px solid var(--border-color); padding-bottom: 15px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
.admin-table th, .admin-table td { padding: 15px; border-bottom: 1px solid var(--border-color); text-align: left; vertical-align: middle; }
.action-btns { display: flex; flex-wrap: nowrap; gap: 8px; justify-content: center; align-items: center; min-height: 42px; width: 100%; } 

.badge { display: inline-flex; align-items:center; justify-content:center; min-width: 110px; height: 28px; padding: 0 12px; border-radius: 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; white-space: nowrap; text-align: center; box-sizing:border-box; }
.r-owner { background: rgba(255, 71, 87, 0.2); color: #ff4757; border: 1px solid #ff4757; }
.r-manager { background: rgba(255, 165, 2, 0.2); color: #ffa502; border: 1px solid #ffa502;}
.r-admin { background: rgba(30, 144, 255, 0.2); color: #1e90ff; border: 1px solid #1e90ff;}
.r-mod { background: rgba(46, 213, 115, 0.2); color: #2ed573; border: 1px solid #2ed573;}
.r-user { background: rgba(164, 176, 190, 0.1); color: #a4b0be; border: 1px solid #a4b0be;}

.modal-bg { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); backdrop-filter: blur(5px); z-index: 1000; justify-content: center; align-items: center; }
.modal-content { background: var(--panel-bg); border: 1px solid var(--border-color); padding: 35px; width: 420px; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.9); animation: popIn 0.3s ease; }

.file-grid, .win-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.file-box, .win-card { position: relative; background: var(--panel2-bg); border: 1px solid var(--border-color); border-radius: 10px; padding: 30px 20px; text-align: center; cursor: pointer; transition: 0.3s; }
.file-box:hover, .win-card:hover { border-color: var(--accent-color); transform: translateY(-5px); box-shadow: 0 5px 15px rgba(232, 67, 98, 0.2); }
.file-box h4, .win-card h4 { font-size: 16px; margin-bottom: 10px; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.file-box p { font-size: 13px; color: var(--text-muted); }

/* TABLO/KART SİLME BUTONLARI JITTER FIX */
.hover-delete-btn { display:none; position:absolute; top:10px; right:10px; background:#e74c3c; color:#fff; border-radius:4px; padding:8px 12px; cursor:pointer; z-index:10; border:none; transition: background 0.2s ease; box-sizing:border-box;}
.hover-delete-btn:hover { background:#c0392b; }
.file-box:hover .hover-delete-btn, .win-card:hover .hover-delete-btn { display:block; }
.action-btns .action-btn { transition: transform 0.2s ease; transform: none; }
.action-btns .action-btn:hover { filter: brightness(1.2); transform: scale(1.05); }

.ann-box { background: var(--panel2-bg); border-left: 4px solid var(--accent-color); padding: 20px; border-radius: 8px; margin-bottom: 15px; }

/* CHAT STYLES */
.chat-container { display: flex; flex-direction: column; min-height: 420px; height: min(650px, 70vh); background: var(--panel-bg); border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; position:relative; }
.chat-messages { flex: 1 1 auto; min-height: 0; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; scroll-behavior: smooth; }
.chat-msg { background: var(--panel2-bg); padding: 15px; border-radius: 8px; position: relative; border: 1px solid transparent; transition: box-shadow 0.3s, border-color 0.3s; }
.chat-msg:hover { border-color: var(--border-color); }
.chat-msg:hover .chat-actions { display: flex; }
.chat-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.chat-header img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border-color); background: var(--app-bg); }
.chat-name { font-weight: bold; color: var(--text-main); font-size: 15px; }
.chat-time { font-size: 11px; color: var(--text-muted); margin-top: 10px; text-align: right; }
.chat-text { font-size: 15px; color: #ddd; line-height: 1.5; word-break: break-word; }
.chat-actions { display: none; position: absolute; top: -10px; right: 10px; background: var(--panel-bg); border: 1px solid var(--border-color); border-radius: 6px; padding: 4px; gap: 5px; box-shadow: 0 2px 5px rgba(0,0,0,0.5); z-index:5; }
.chat-actions i { cursor: pointer; color: var(--text-muted); padding: 6px; transition: 0.2s; font-size:13px; }
.chat-actions i:hover { color: var(--text-main); }
.chat-reply-ref { font-size: 12px; color: var(--text-muted); border-left: 2px solid var(--accent-color); padding-left: 8px; margin-bottom: 8px; background: rgba(0,0,0,0.2); padding: 6px 10px; border-radius: 4px; cursor: pointer; transition: 0.2s; }
.chat-reply-ref:hover { background: rgba(232, 67, 98, 0.1); color: var(--text-main); }
.persist-highlight { box-shadow: 0 0 15px var(--accent-color) !important; border-color: var(--accent-color) !important; }

/* INLINE EDIT */
.inline-edit-input { width:100%; background:var(--app-bg); color:var(--text-main); border:1px solid var(--accent-color); padding:10px; border-radius:6px; font-size:14px; outline:none; font-family:inherit;}

.chat-input-area { display: flex; flex-direction: column; gap: 10px; padding: 15px; background: var(--panel2-bg); border-top: 1px solid var(--border-color); position: relative; flex: 0 0 auto; overflow: visible; }
.chat-replying-box { display: none; align-items: center; justify-content: space-between; font-size: 13px; color: var(--accent-color); margin-bottom: 10px; background: var(--app-bg); padding: 10px 15px; border-radius: 6px; border: 1px solid var(--border-color); font-weight:bold; }
.chat-input-row { display: grid; grid-template-columns: minmax(0,1fr) 52px; gap: 10px; align-items: end; width: 100%; }
.chat-input-row input { width: 100%; min-width: 0; margin: 0; }
.chat-input-row .action-btn { width: 52px; height: 52px; padding: 0; }

.game-desc-box { background:var(--panel-bg); border:1px solid var(--border-color); border-radius:8px; padding:15px; margin-bottom:20px; }
.game-desc-header { color:var(--accent-color); margin-bottom:10px; border-bottom:1px solid var(--border-color); padding-bottom:5px; font-weight:bold; font-size:15px; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--scrollbar-bg); }
::-webkit-scrollbar-thumb { background-color: var(--scrollbar-thumb); border-radius: 10px; }

.py-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.listbox { background: var(--panel2-bg); border: 1px solid var(--border-color); border-radius: 8px; overflow-y: auto; height: 300px; padding: 10px 0; margin-bottom:15px;}
.list-item { padding: 12px 20px; font-size: 14px; cursor: pointer; transition: 0.2s; border-left: 3px solid transparent; }
.list-item:hover { background: var(--hover-bg); }
.list-item.selected { background: rgba(232, 67, 98, 0.1); border-left-color: var(--accent-color); color: var(--accent-color); font-weight: bold; }
.log-box { width: 100%; height: 200px; background: var(--panel2-bg); color: var(--text-main); border: 1px solid var(--border-color); padding: 15px; font-family: 'Consolas', monospace; font-size: 13px; border-radius: 8px; resize: none; outline:none; --mx:50%; --my:50%; transition: box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease; }
.log-box.hover-pressure { background: radial-gradient(180px circle at var(--mx) var(--my), rgba(255,255,255,0.08), rgba(255,255,255,0.03) 22%, rgba(0,0,0,0) 60%), var(--panel2-bg); box-shadow: inset 0 1px 14px rgba(0,0,0,0.45), inset 0 -1px 10px rgba(255,255,255,0.03), 0 0 18px rgba(232,67,98,0.10); border-color: rgba(232,67,98,0.45); }
select.role-select { background: var(--panel2-bg); color: var(--text-main); border: 1px solid var(--border-color); padding: 6px; border-radius: 6px; font-size: 13px; font-weight: bold; outline:none; cursor:pointer;}

#toast-container { position: fixed; top: 30px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { background: rgba(13, 4, 6, 0.95); backdrop-filter: blur(10px); border: 1px solid var(--accent-color); color: var(--text-main); padding: 15px 40px; border-radius: 50px; font-size: 15px; font-weight: 600; animation: toastIn 0.3s forwards; }
.toast span { font-weight: normal; color: var(--text-muted); font-size: 14px; margin-left: 8px;}
@keyframes toastIn { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
.toast-fadeout { animation: toastOut 0.4s forwards; }
@keyframes toastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-30px); } }

/* ANA SAYFA TASARIMI */
.home-layout { width: 100%; min-height: 100%; display: flex; z-index: 2; position: relative; background: rgba(0,0,0,0.3); }
.home-left { flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 80px; }
.home-left-bottom { margin-top: auto; }
.home-right { flex: 1; display: flex; justify-content: center; align-items: center; perspective: 1000px; }
.tilt-logo { width: 100%; max-width: 450px; transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, filter 0.12s ease-out; transform-style: preserve-3d; filter: drop-shadow(0 20px 40px rgba(0,0,0,0.8)); border: 4px solid var(--accent-color); box-shadow: 0 0 30px rgba(232, 67, 98, 0.4); border-radius: 20px; }
#logo-container { --mx:50%; --my:50%; position: relative; }
#logo-container.logo-pressure-active::after { content:''; position:absolute; inset:0; border-radius:24px; pointer-events:none; background: radial-gradient(180px circle at var(--mx) var(--my), rgba(255,255,255,0.10), rgba(255,255,255,0.03) 26%, rgba(0,0,0,0) 62%); }
#logo-container.logo-pressure-active .tilt-logo { box-shadow: inset 0 2px 16px rgba(0,0,0,0.30), 0 0 24px rgba(232, 67, 98, 0.35), 0 8px 30px rgba(0,0,0,0.60); filter: drop-shadow(0 16px 32px rgba(0,0,0,0.82)) brightness(1.03); }

.link-row { display: flex; gap: 10px; align-items: center; width: 100%; }
.link-row input { flex: 1; }

.powered-link { color:#ff87a1; font-size:18px; text-shadow: 0 0 10px rgba(255,135,161,0.6); text-decoration:none; font-weight:bold; transition:0.3s; display:inline-block; margin-top:5px; }
.powered-link:hover { color:#ffb0c2; text-shadow: 0 0 20px rgba(255,176,194,1); transform:scale(1.02); }
.admin-mini-btn { min-width: 38px; min-height: 38px; padding: 8px !important; }
.role-option-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:10px; }
.role-option-btn { background: var(--panel2-bg); color: var(--text-main); border: 1px solid var(--border-color); border-radius: 8px; padding: 12px; font-weight: 700; cursor: pointer; transition: 0.2s; width: 100%; box-sizing: border-box; }
.role-option-btn:hover { border-color: var(--accent-color); box-shadow: 0 0 12px rgba(232, 67, 98, 0.18); }
.role-option-btn.active { background: var(--accent-color); color: #fff; border-color: var(--accent-color); box-shadow: 0 0 16px rgba(232, 67, 98, 0.28); }


.locked-badge { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-width:110px; height:30px; padding:0 14px; border:1px solid rgba(255,87,87,0.7); border-radius:8px; color:#ff5f5f; font-size:12px; font-weight:800; }
.role-option-btn.disabled { opacity:0.42; cursor:not-allowed; filter:grayscale(0.2); box-shadow:none; }
.role-option-btn.disabled:hover { border-color: var(--border-color); box-shadow:none; }
#view-admin .admin-table th:nth-child(1), #view-admin .admin-table td:nth-child(1) { width: 22%; }
#view-admin .admin-table th:nth-child(2), #view-admin .admin-table td:nth-child(2) { width: 22%; }
#view-admin .admin-table th:nth-child(3), #view-admin .admin-table td:nth-child(3) { width: 18%; text-align:center; }
#view-admin .admin-table th:nth-child(4), #view-admin .admin-table td:nth-child(4) { width: 22%; text-align:center; }
#view-logs .admin-table th:nth-child(1), #view-logs .admin-table td:nth-child(1) { width: 22%; }
#view-logs .admin-table th:nth-child(2), #view-logs .admin-table td:nth-child(2) { width: 22%; }
#view-logs .admin-table th:nth-child(3), #view-logs .admin-table td:nth-child(3) { width: 18%; text-align:center; }
#view-logs .admin-table th:nth-child(4), #view-logs .admin-table td:nth-child(4) { width: 38%; }
#view-admin .admin-table td:nth-child(3), #view-logs .admin-table td:nth-child(3) { padding-left:0; padding-right:0; }
#view-admin .action-btns .admin-mini-btn { width: 38px; height: 38px; min-width: 38px; min-height: 38px; }
#view-admin .locked-badge { min-width:110px; height:30px; margin: 0 auto; }


@media (max-width: 980px) {
    body { overflow: auto; height: auto; }
    #app-hub { height: auto !important; min-height: 100vh; flex-direction: column; }
    .sidebar { width: 100%; min-width: 0; height: auto; border-right: none; border-bottom: 1px solid var(--border-color); }
    .sidebar-footer { margin-top: 0; }
    #app-hub, .home-layout { flex-direction: column; }
    .content-area { min-height: 0; height: auto; }
    .view { padding: 20px; }
    .home-left { padding: 28px 20px; }
    .home-right { padding: 20px; }
    .py-grid { grid-template-columns: 1fr; }
    .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 640px) {
    .login-box, .modal-content { width: calc(100vw - 24px); padding: 22px; }
    .panel { padding: 18px; }
    .file-grid, .win-grid { grid-template-columns: 1fr; }
    .chat-input-row { display: grid; grid-template-columns: minmax(0,1fr) 52px; gap: 10px; align-items: end; width: 100%; }
    .chat-input-row .action-btn { width: 52px; height: 52px; padding: 0; }
}

#view-chat .panel-header { flex: 0 0 auto; }
#view-chat .chat-container { margin-bottom: 0; }
#view-chat .chat-input-row .action-btn i { pointer-events: none; }



/* Voice tile focus state */
.voice-tile.tile-focused {
    outline: 2px solid var(--accent-color);
    box-shadow: 0 0 16px rgba(231,76,60,0.5);
}
.voice-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}
