:root {
  --bg-color: #0d111d;
  --card-bg: #141b2d;
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --btn-primary: #3b82f6;
  --btn-primary-hover: #2563eb;
  --border-color: #1e293b;
  --font-family: 'Inter', sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden; /* Prevent body scroll, limit to main content */
}

/* Dashboard Global Structural Framework */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Sidebar Styling */
.sidebar {
  width: 280px;
  background-color: #0d111d;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  padding: 2rem 1rem;
  z-index: 10;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
  margin-bottom: 3rem;
}

.logo-k {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: white;
  font-weight: 800;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  letter-spacing: 0.05em;
}

.logo-text span {
  font-size: 0.75rem;
  font-weight: 400;
  color: #94a3b8;
  letter-spacing: 0.1em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 0.875rem 1rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-item:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
  color: #fff;
  background: rgba(59, 130, 246, 0.1);
  border-left: 3px solid #3b82f6;
  border-radius: 4px 8px 8px 4px; /* Straight edge on active left border */
}

/* Main Content Styling */
.main-content {
  flex: 1;
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.05) 0%, transparent 40%), var(--bg-color);
  overflow-y: auto;
  padding: 3rem;
  display: flex;
  flex-direction: column;
}

/* Top Right Interactive Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 3rem;
}

.page-sub {
  font-size: 1.1rem;
  font-weight: 500;
  color: #e2e8f0;
  margin-bottom: 1rem;
}

.page-main-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.02em;
}

.global-search-bar {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px; /* full pill */
  padding: 0.75rem 1.5rem;
  width: 350px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.global-search-bar:focus-within {
  border-color: #3b82f6;
  background: rgba(255, 255, 255, 0.08);
}

.global-search-bar svg {
  color: #94a3b8;
  margin-right: 0.75rem;
  width: 18px;
  height: 18px;
}

.global-search-bar input {
  background: transparent;
  border: none;
  color: #fff;
  width: 100%;
  padding: 0;
  font-size: 0.95rem;
  outline: none;
}

.global-search-bar input::placeholder {
  color: #64748b;
}

.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

input, textarea {
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: #0f1423;
  color: var(--text-primary);
  font-family: var(--font-family);
  transition: border-color 0.2s;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--btn-primary);
}

.btn-primary {
  background-color: var(--btn-primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: var(--btn-primary-hover);
}

/* FAQ List styles */
.search-bar {
  margin-bottom: 2rem;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.article-item {
  background-color: #0f1423;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: border-color 0.2s, background-color 0.2s;
}

.article-item:hover {
  border-color: var(--btn-primary);
  background-color: #141b2d;
}

.article-title {
  font-size: 1.125rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.article-body {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Tickets Table */
.ticket-list {
    margin-top: 1.5rem;
}

.ticket-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ticket-item:last-child {
    border-bottom: none;
}
.ticket-subject {
    font-weight: 600;
}
.ticket-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.ticket-status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.status-new { background-color: #f59e0b; color: #fff; }
.status-open { background-color: #ef4444; color: #fff; }
.status-pending { background-color: #3b82f6; color: #fff; }
.status-solved { background-color: #10b981; color: #fff; }
.status-closed { background-color: #6b7280; color: #fff; }

.notification {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
.notification.success {
    background-color: #064e3b;
    border: 1px solid #059669;
    color: #34d399;
}
.notification.error {
    background-color: #7f1d1d;
    border: 1px solid #dc2626;
    color: #fca5a5;
}

.loader {
    border: 4px solid #f3f3f3; 
    border-top: 4px solid var(--btn-primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modern FAQ Grid Layout */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}
@media (max-width: 768px) {
    .faq-grid {
        grid-template-columns: 1fr;
    }
}
.category-card {
    background: linear-gradient(145deg, var(--card-bg), #1a2235);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
    border-color: rgba(59, 130, 246, 0.4);
}
.category-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--btn-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(59, 130, 246, 0.2);
}
.section-wrapper {
    margin-bottom: 1rem;
}
.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.article-link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    background-color: rgba(15, 20, 35, 0.4);
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    cursor: pointer;
}
.article-link:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: white;
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateX(4px);
}
.faq-article-view {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    margin-top: 1.5rem;
    animation: fadeIn 0.3s ease-in-out;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.faq-article-view h1 { font-size: 2rem; color: #fff; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; }
.faq-article-view .body { font-size: 1.05rem; line-height: 1.6; color: #cbd5e1; }
.faq-article-view .body img { max-width: 100%; height: auto; border-radius: 8px; margin: 15px 0; }
.back-btn {
    background: transparent;
    border: none;
    color: var(--btn-primary);
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}
.back-btn:hover { text-decoration: underline; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Premium FAQ Redesign CSS */
.glass-card {
    background: rgba(20, 27, 45, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
    border-color: rgba(59, 130, 246, 0.3);
}

.cat-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 1.25rem;
}

.cat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
    flex-shrink: 0;
}

.cat-icon svg {
    width: 24px;
    height: 24px;
}

.cat-title-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

/* Accordion Articles */
.accordion-item {
    background: rgba(15, 20, 35, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-item.expanded {
    background: rgba(20, 27, 45, 0.9);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.accordion-btn {
    width: 100%;
    text-align: left;
    padding: 1.25rem;
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 1.05rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s ease;
}

.accordion-btn:hover {
    color: #ffffff;
}

.accordion-btn .chevron {
    color: #3b82f6;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.accordion-btn .chevron.expanded {
    transform: rotate(90deg);
}

.accordion-content {
    padding: 0 1.25rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease;
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.6;
}

.accordion-item.expanded .accordion-content {
    max-height: 500px; /* Arbitrary high value to allow expansion */
    opacity: 1;
    padding: 0.5rem 1.25rem 1.25rem 1.25rem;
    overflow-y: auto;
}

/* Scrollbar for accordion content */
.accordion-content::-webkit-scrollbar {
    width: 4px;
}
.accordion-content::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 4px;
}

/* Pagination Footer */
.pagination-pills {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1.5rem;
}

.page-btn {
    background: rgba(15, 20, 35, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-btn:not(:disabled):hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
    transform: scale(1.05);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
