/* ===== GIGIZ TICKET SYSTEM CSS ===== */
:root {
    --primary: #c0392b;
    --primary-dark: #922b21;
    --secondary: #1a1a2e;
    --accent: #e74c3c;
    --bg: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card2: #16213e;
    --text: #e8e8f0;
    --text-muted: #8888aa;
    --border: #2a2a4a;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

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

.navbar {
    background: linear-gradient(135deg, var(--secondary), #0f0f1a);
    border-bottom: 2px solid var(--primary);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 65px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(192,57,43,0.3);
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.navbar-brand img { height: 35px; }
.navbar-brand span { color: var(--accent); }

.navbar-nav { display: flex; gap: 5px; align-items: center; }

.nav-link {
    color: var(--text-muted);
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-link:hover, .nav-link.active {
    color: #fff;
    background: rgba(192,57,43,0.3);
    text-decoration: none;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.page-wrapper { padding: 30px 20px; max-width: 1200px; margin: 0 auto; }

.admin-layout { display: flex; min-height: calc(100vh - 65px); }

.sidebar {
    width: 250px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    flex-shrink: 0;
    position: sticky;
    top: 65px;
    height: calc(100vh - 65px);
    overflow-y: auto;
}

.sidebar-section { margin-bottom: 20px; }
.sidebar-title {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 20px 10px;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.sidebar-link:hover, .sidebar-link.active {
    background: rgba(192,57,43,0.2);
    color: #fff;
    border-left: 3px solid var(--primary);
    padding-left: 17px;
    text-decoration: none;
}

.sidebar-link i { width: 18px; text-align: center; }

.admin-content { flex: 1; padding: 30px; overflow-x: hidden; }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.02);
}

.card-title { font-size: 1.1rem; font-weight: 600; color: #fff; }
.card-body { padding: 25px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; margin-bottom: 25px; }

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-value { font-size: 1.8rem; font-weight: 700; color: #fff; line-height: 1; }
.stat-label { color: var(--text-muted); font-size: 0.8rem; margin-top: 3px; }

.table-responsive { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

table thead tr {
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--border);
}

table th {
    padding: 12px 15px;
    text-align: left;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

table td {
    padding: 13px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.9rem;
    vertical-align: middle;
}

table tbody tr:hover { background: rgba(255,255,255,0.03); }
table tbody tr:last-child td { border-bottom: none; }

.form-group { margin-bottom: 20px; }

label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 6px;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 7px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(192,57,43,0.15);
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

select option { background: var(--bg-card); }
textarea { min-height: 120px; resize: vertical; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; }

.required { color: var(--danger); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: 7px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: rgba(255,255,255,0.1); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: rgba(255,255,255,0.15); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-info { background: var(--info); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 13px 28px; font-size: 1rem; }

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success { background: rgba(39,174,96,0.15); border: 1px solid rgba(39,174,96,0.4); color: #2ecc71; }
.alert-danger { background: rgba(231,76,60,0.15); border: 1px solid rgba(231,76,60,0.4); color: #e74c3c; }
.alert-info { background: rgba(52,152,219,0.15); border: 1px solid rgba(52,152,219,0.4); color: #3498db; }
.alert-warning { background: rgba(243,156,18,0.15); border: 1px solid rgba(243,156,18,0.4); color: #f39c12; }

.ticket-row { cursor: pointer; }
.ticket-row:hover td { background: rgba(192,57,43,0.08); }

.ticket-subject { font-weight: 600; color: #fff; }
.ticket-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 3px; }

.ticket-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.ticket-info-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
}

.ticket-info-label { color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }
.ticket-info-value { color: #fff; font-weight: 500; }

.reply {
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
}

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--border);
}

.reply-author { font-weight: 600; font-size: 0.9rem; }
.reply-author.admin { color: var(--accent); }
.reply-author.player { color: #5dade2; }
.reply-date { color: var(--text-muted); font-size: 0.8rem; }
.reply-body { padding: 18px; white-space: pre-wrap; font-size: 0.9rem; line-height: 1.7; }

.pagination { display: flex; gap: 5px; justify-content: center; margin-top: 20px; }
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 7px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.page-link:hover { background: var(--primary); color: #fff; text-decoration: none; }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.hero {
    background: linear-gradient(135deg, var(--secondary) 0%, #0f0f1a 100%);
    border-bottom: 1px solid var(--border);
    padding: 50px 20px;
    text-align: center;
}

.hero h1 { font-size: 2.2rem; color: #fff; margin-bottom: 10px; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 500px; margin: 0 auto; }

.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: var(--text);
    display: block;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(192,57,43,0.2);
    color: var(--text);
    text-decoration: none;
}

.category-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    margin: 0 auto 15px;
}

.category-name { font-weight: 600; font-size: 1rem; color: #fff; margin-bottom: 5px; }
.category-desc { color: var(--text-muted); font-size: 0.85rem; }

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f1a 100%);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h2 { color: #fff; font-size: 1.5rem; }
.login-logo span { color: var(--accent); }
.login-logo p { color: var(--text-muted); font-size: 0.85rem; margin-top: 5px; }

.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: center;
}

.filter-bar input, .filter-bar select { width: auto; flex: 1; min-width: 150px; }

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
}
.modal-title { font-size: 1.1rem; font-weight: 600; color: #fff; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.status-open { color: #27ae60; }
.status-waiting { color: #f39c12; }
.status-closed { color: #e74c3c; }

.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #444;
    border-radius: 24px;
    transition: 0.3s;
}
.toggle-slider:before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}
input:checked + .toggle-slider { background: var(--primary); }
input:checked + .toggle-slider:before { transform: translateX(20px); }

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 15px; }
.mt-3 { margin-top: 25px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 15px; }
.mb-3 { margin-bottom: 25px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: 10px; }
.flex-1 { flex: 1; }

.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

input[type="color"] { width: 50px; height: 38px; padding: 2px; cursor: pointer; border-radius: 5px; }

.attachment-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.attachment-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ticket-status-card {
    max-width: 800px;
    margin: 30px auto;
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .admin-content { padding: 15px; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .navbar-brand span { display: none; }
    .filter-bar { flex-direction: column; }
    .filter-bar input, .filter-bar select { width: 100%; }
    .hero h1 { font-size: 1.5rem; }
}

.reply-body code.msg-code-inline {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: 'Consolas','Courier New',monospace;
    font-size: 0.88em;
    color: #e8b86d;
}

.reply-body pre.msg-code-block {
    background: #0d0d1a;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    overflow-x: auto;
    margin: 10px 0;
    font-family: 'Consolas','Courier New',monospace;
    font-size: 0.87em;
    color: #a8d8a8;
    line-height: 1.6;
    white-space: pre;
}

.reply-body pre.msg-code-block code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.msg-table-wrap {
    overflow-x: auto;
    margin: 12px 0;
}

.msg-table {
    border-collapse: collapse;
    width: auto;
    min-width: 200px;
    font-size: 0.88em;
}

.msg-table th,
.msg-table td {
    border: 1px solid var(--border);
    padding: 7px 14px;
    text-align: left;
    white-space: nowrap;
}

.msg-table thead tr { background: rgba(192,57,43,0.2); }
.msg-table th       { color: #fff; font-weight: 600; }
.msg-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.03); }
.msg-table tbody tr:hover           { background: rgba(255,255,255,0.06); }

.reply-body a {
    color: var(--accent);
    text-decoration: underline;
}
.reply-body a:hover { opacity: 0.85; }

.editor-toolbar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 7px 7px 0 0;
    padding: 6px 10px;
}

.editor-toolbar .tb-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
    white-space: nowrap;
}
.editor-toolbar .tb-btn:hover {
    background: rgba(192,57,43,0.3);
    color: #fff;
    border-color: var(--primary);
}
.editor-toolbar .tb-sep {
    width: 1px;
    background: var(--border);
    margin: 2px 3px;
    align-self: stretch;
}

.editor-toolbar .tb-btn b  { font-weight: 900; font-size: 0.95rem; }
.editor-toolbar .tb-btn em { font-style: italic; }

textarea.editor-textarea {
    border-radius: 0 0 7px 7px !important;
    border-top: none !important;
    font-family: 'Consolas','Courier New',monospace;
    font-size: 0.88rem;
    line-height: 1.65;
}
textarea.editor-textarea:focus {
    border-top: none !important;
}

.editor-preview {
    display: none;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0 0 7px 7px;
    padding: 15px;
    min-height: 100px;
    font-size: 0.9rem;
    line-height: 1.7;
}
.editor-preview.active { display: block; }

.tb-btn.active-tab {
    background: rgba(192,57,43,0.3);
    color: #fff;
    border-color: var(--primary);
}
