/**
 * eFit Helpdesk Professional UI/UX Styles
 * Modern, clean, and accessible design system
 * Compatible with Bootstrap 5 and dashboard-v3.css
 */

/* ============================================================================
   CSS Custom Properties - Design Tokens
   ============================================================================ */
:root {
    /* Brand Colors */
    --hd-primary: #1b6ec2;
    --hd-primary-hover: #155a9c;
    --hd-primary-light: #e8f4fd;
    --hd-primary-dark: #0d4a86;

    /* Status Colors */
    --hd-success: #10b981;
    --hd-success-light: #d1fae5;
    --hd-warning: #f59e0b;
    --hd-warning-light: #fef3c7;
    --hd-danger: #ef4444;
    --hd-danger-light: #fee2e2;
    --hd-info: #0ea5e9;
    --hd-info-light: #e0f2fe;

    /* Neutrals */
    --hd-gray-50: #f9fafb;
    --hd-gray-100: #f3f4f6;
    --hd-gray-200: #e5e7eb;
    --hd-gray-300: #d1d5db;
    --hd-gray-400: #9ca3af;
    --hd-gray-500: #6b7280;
    --hd-gray-600: #4b5563;
    --hd-gray-700: #374151;
    --hd-gray-800: #1f2937;
    --hd-gray-900: #111827;

    /* Shadows */
    --hd-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --hd-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --hd-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --hd-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --hd-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Border Radius */
    --hd-radius-sm: 0.375rem;
    --hd-radius-md: 0.5rem;
    --hd-radius-lg: 0.75rem;
    --hd-radius-xl: 1rem;
    --hd-radius-2xl: 1.5rem;
    --hd-radius-full: 9999px;

    /* Transitions */
    --hd-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --hd-transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --hd-transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================================
   Base Layout
   ============================================================================ */
.menu {
    margin: 0 auto 20px;
    padding: 0 15px;
}

.content {
    margin: 0 auto;
    padding: 0 15px 40px;
    max-width: 1400px;
}

/* ============================================================================
   Typography
   ============================================================================ */
h1, h2, h3, h4, h5, h6 {
    color: var(--hd-gray-800);
    font-weight: 600;
}

/* ============================================================================
   Buttons - Professional styling
   ============================================================================ */
.btn {
    font-weight: 500;
    border-radius: var(--hd-radius-md);
    transition: all var(--hd-transition-fast);
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--hd-shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--hd-primary) 0%, var(--hd-primary-dark) 100%);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--hd-primary-hover) 0%, var(--hd-primary-dark) 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--hd-success) 0%, #059669 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, var(--hd-danger) 0%, #dc2626 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--hd-warning) 0%, #d97706 100%);
    border: none;
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, var(--hd-info) 0%, #0284c7 100%);
    border: none;
}

.btn-outline-secondary {
    border: 2px solid var(--hd-gray-300);
    color: var(--hd-gray-700);
    background: white;
}

.btn-outline-secondary:hover {
    background: var(--hd-gray-100);
    border-color: var(--hd-gray-400);
    color: var(--hd-gray-800);
}

.btn-outline-info {
    border: 2px solid var(--hd-info);
    color: var(--hd-info);
    background: white;
}

.btn-outline-info:hover {
    background: var(--hd-info);
    color: white;
}

.btn-outline-success {
    border: 2px solid var(--hd-success);
    color: var(--hd-success);
    background: white;
}

.btn-outline-success:hover {
    background: var(--hd-success);
    color: white;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* ============================================================================
   Navigation Menu - Modern pill style
   ============================================================================ */
.d-flex.gap-2 {
    background: white;
    padding: 1rem;
    border-radius: var(--hd-radius-xl);
    box-shadow: var(--hd-shadow-sm);
    border: 1px solid var(--hd-gray-200);
}

.d-flex.gap-2 .btn {
    border-radius: var(--hd-radius-full);
}

/* ============================================================================
   Cards - Elevated design
   ============================================================================ */
.card {
    border: none;
    border-radius: var(--hd-radius-lg);
    box-shadow: var(--hd-shadow-sm);
    background: white;
    overflow: hidden;
    transition: box-shadow var(--hd-transition-normal);
}

.card:hover {
    box-shadow: var(--hd-shadow-md);
}

.card-header {
    background: linear-gradient(135deg, var(--hd-gray-50) 0%, white 100%);
    border-bottom: 1px solid var(--hd-gray-200);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--hd-gray-800);
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: var(--hd-gray-50);
    border-top: 1px solid var(--hd-gray-200);
    padding: 0.875rem 1.25rem;
}

/* ============================================================================
   Tables - Clean modern design
   ============================================================================ */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, var(--hd-gray-100) 0%, var(--hd-gray-50) 100%);
    font-weight: 600;
    color: var(--hd-gray-700);
    border-bottom: 2px solid var(--hd-gray-200);
    padding: 1rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--hd-gray-100);
    color: var(--hd-gray-700);
}

.table tbody tr {
    transition: background var(--hd-transition-fast);
}

.table tbody tr:hover {
    background: var(--hd-primary-light);
}

.table-striped tbody tr:nth-of-type(odd) {
    background: var(--hd-gray-50);
}

.table-striped tbody tr:nth-of-type(odd):hover {
    background: var(--hd-primary-light);
}

/* Table wrapper with rounded corners */
.table-responsive {
    background: white;
    border-radius: var(--hd-radius-lg);
    box-shadow: var(--hd-shadow-sm);
    overflow: hidden;
    border: 1px solid var(--hd-gray-200);
}

/* ============================================================================
   Badges - Priority & Status
   ============================================================================ */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: var(--hd-radius-full);
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.badge i {
    font-size: 0.625rem;
}

/* Priority badges with subtle gradients */
.badge.bg-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%) !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.badge.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--hd-primary) 0%, var(--hd-primary-dark) 100%) !important;
}

/* Status labels (legacy support) */
.label-success,
.label-danger {
    padding: 0.375rem 0.75rem;
    border-radius: var(--hd-radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.label-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.label-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

/* ============================================================================
   Forms - Modern inputs
   ============================================================================ */
.form-control,
.form-select {
    border: 2px solid var(--hd-gray-200);
    border-radius: var(--hd-radius-md);
    padding: 0.625rem 1rem;
    transition: all var(--hd-transition-fast);
    font-size: 0.9375rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--hd-primary);
    box-shadow: 0 0 0 4px var(--hd-primary-light);
    outline: none;
}

.form-control::placeholder {
    color: var(--hd-gray-400);
}

.form-label,
.control-label {
    font-weight: 500;
    color: var(--hd-gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* File input styling */
input[type="file"] {
    padding: 0.5rem;
    border: 2px dashed var(--hd-gray-300);
    border-radius: var(--hd-radius-md);
    background: var(--hd-gray-50);
    cursor: pointer;
    transition: all var(--hd-transition-fast);
}

input[type="file"]:hover {
    border-color: var(--hd-primary);
    background: var(--hd-primary-light);
}

/* Radio buttons */
.radio-inline {
    margin-right: 1rem;
    cursor: pointer;
}

.radio-inline input[type="radio"] {
    margin-right: 0.375rem;
}

/* ============================================================================
   Search Box - Enhanced filter panel
   ============================================================================ */
.search .alert-dark,
.search .mb-3.alert-dark {
    background: white;
    border: 1px solid var(--hd-gray-200);
    color: var(--hd-gray-700);
    border-radius: var(--hd-radius-xl);
    box-shadow: var(--hd-shadow-sm);
    padding: 1.5rem;
}

.search .form-control {
    border-radius: var(--hd-radius-full);
}

/* ============================================================================
   Alerts - Softer, modern alerts
   ============================================================================ */
.alert {
    border-radius: var(--hd-radius-lg);
    border: none;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: var(--hd-success-light);
    color: #065f46;
    border-left: 4px solid var(--hd-success);
}

.alert-danger {
    background: var(--hd-danger-light);
    color: #991b1b;
    border-left: 4px solid var(--hd-danger);
}

.alert-warning {
    background: var(--hd-warning-light);
    color: #92400e;
    border-left: 4px solid var(--hd-warning);
}

.alert-info {
    background: var(--hd-info-light);
    color: #075985;
    border-left: 4px solid var(--hd-info);
}

.alert-primary {
    background: var(--hd-primary-light);
    color: var(--hd-primary-dark);
    border-left: 4px solid var(--hd-primary);
}

/* ============================================================================
   Ticket Info Sidebar
   ============================================================================ */
.ticket-info {
    background: white;
}

.ticket-info .card-header {
    background: linear-gradient(135deg, var(--hd-primary) 0%, var(--hd-primary-dark) 100%);
    color: white;
}

.ticket-info .card-header strong {
    color: white;
}

.ticket-info .info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--hd-gray-100);
}

.ticket-info .info-item:last-child {
    border-bottom: none;
}

.ticket-info .info-label {
    font-weight: 500;
    color: var(--hd-gray-500);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.ticket-info .info-value {
    font-weight: 500;
    color: var(--hd-gray-800);
}

/* ============================================================================
   Ticket Reply Cards
   ============================================================================ */
.replies .card {
    border-left: 4px solid var(--hd-gray-300);
    margin-bottom: 1rem;
    transition: all var(--hd-transition-fast);
}

.replies .card:hover {
    border-left-color: var(--hd-primary);
}

.replies .card-header {
    background: transparent;
    border-bottom: 1px solid var(--hd-gray-100);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Admin reply styling */
.replies .card.admin-reply,
.replies .card:has(.fa-building) {
    border-left-color: var(--hd-success);
    background: linear-gradient(135deg, #f0fdf4 0%, white 100%);
}

.comment-post {
    padding: 0.5rem 0;
}

.comment-post p {
    margin-bottom: 0;
    line-height: 1.7;
    color: var(--hd-gray-700);
}

/* ============================================================================
   WYSIWYG Editor - Hide unused toolbar groups
   ============================================================================ */
#toolbarGroup-mode,
#toolbarGroup-special,
#toolbarGroup-insert,
#toolbarGroup-styles,
#toolbarGroup-fonts,
#toolbarGroup-components,
#toolbarGroup-intervals {
    display: none;
}

.wysiwyg-editor {
    border-radius: var(--hd-radius-md);
    border: 2px solid var(--hd-gray-200);
}

/* ============================================================================
   Ticket Status Indicators
   ============================================================================ */
.visible-ticket {
    display: table-row;
}

.hidden-ticket {
    display: none;
}

/* ============================================================================
   Loading States
   ============================================================================ */
.spinner-border {
    display: none;
}

.loading .spinner-border {
    display: inline-block;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Skeleton loading animation */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--hd-gray-200) 25%, var(--hd-gray-100) 50%, var(--hd-gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--hd-radius-sm);
}

/* ============================================================================
   Empty States
   ============================================================================ */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--hd-gray-500);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    color: var(--hd-gray-700);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* ============================================================================
   Quick Response / Canned Responses
   ============================================================================ */
.canned-response-select {
    background: var(--hd-gray-50);
    border: 2px solid var(--hd-gray-200);
    border-radius: var(--hd-radius-md);
    padding: 0.5rem;
}

.canned-response-select:focus {
    border-color: var(--hd-warning);
    box-shadow: 0 0 0 4px var(--hd-warning-light);
}

/* ============================================================================
   Analytics Dashboard Cards
   ============================================================================ */
.analytics-dashboard {
    overflow: hidden;
}

.analytics-dashboard .row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.analytics-dashboard [class*="col-"] {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.stat-card {
    border-radius: var(--hd-radius-xl);
    padding: 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.stat-card h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: white;
}

.stat-card p {
    opacity: 0.9;
    margin: 0;
    font-size: 0.9375rem;
}

.stat-card.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-card.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-card.bg-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.stat-card.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.chart-container {
    background: white;
    border-radius: var(--hd-radius-xl);
    padding: 1.5rem;
    box-shadow: var(--hd-shadow-sm);
    border: 1px solid var(--hd-gray-200);
    height: 100%;
}

.chart-container h5 {
    color: var(--hd-gray-700);
    font-size: 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================================================
   Knowledge Base Styling
   ============================================================================ */
.kb-container {
    max-width: 1200px;
    margin: 0 auto;
}

.kb-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--hd-radius-2xl);
    position: relative;
    overflow: hidden;
    padding: 3rem 2rem 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.kb-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -25%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
    pointer-events: none;
}

.kb-header::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -25%;
    width: 60%;
    height: 150%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 50%);
    pointer-events: none;
}

.kb-header-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.25rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--hd-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.kb-header-icon i {
    font-size: 2.25rem;
    color: white;
}

.kb-header h1 {
    color: #ffffff;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
    position: relative;
    letter-spacing: -0.025em;
}

.kb-header p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.75rem;
    font-size: 1.0625rem;
    position: relative;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.kb-search {
    max-width: 640px;
    margin: 0 auto;
    position: relative;
}

.kb-search .input-group {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: var(--hd-radius-full) !important;
    overflow: hidden;
    background: #ffffff;
}

.kb-search .input-group .input-group-text {
    background: #ffffff;
    border: none;
    padding-left: 1.25rem;
    padding-right: 0.5rem;
    color: var(--hd-gray-400);
}

.kb-search .input-group .form-control {
    border: none !important;
    padding: 1rem 0.75rem;
    font-size: 1rem;
    background: #ffffff;
    height: auto;
}

.kb-search .input-group .form-control::placeholder {
    color: var(--hd-gray-400);
}

.kb-search .input-group .form-control:focus {
    box-shadow: none !important;
    outline: none;
}

.kb-search .input-group .btn,
.kb-search .input-group .btn.btn-light {
    border-radius: 0 var(--hd-radius-full) var(--hd-radius-full) 0 !important;
    padding: 1rem 1.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 600;
    height: auto;
    transition: all var(--hd-transition-fast);
}

.kb-search .input-group .btn:hover,
.kb-search .input-group .btn.btn-light:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%) !important;
    color: #ffffff !important;
    transform: none;
    box-shadow: none;
}

.kb-header-hints {
    margin-top: 1.25rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.kb-header-hints span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

.kb-header-hints a {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: var(--hd-radius-full);
    font-size: 0.8125rem;
    text-decoration: none;
    transition: all var(--hd-transition-fast);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.kb-header-hints a:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    text-decoration: none;
}

.kb-article-card {
    background: white;
    border-radius: var(--hd-radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--hd-gray-200);
    transition: all var(--hd-transition-normal);
    margin-bottom: 1rem;
}

.kb-article-card:hover {
    border-color: var(--hd-primary);
    box-shadow: var(--hd-shadow-lg);
    transform: translateY(-2px);
}

.kb-article-card h5 {
    margin-bottom: 0.75rem;
}

.kb-article-card h5 a {
    color: var(--hd-gray-800);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.kb-article-card h5 a:hover {
    color: var(--hd-primary);
}

.kb-article-card .views {
    color: var(--hd-gray-500);
    font-size: 0.875rem;
}

.kb-sidebar {
    background: white;
    border-radius: var(--hd-radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--hd-gray-200);
    box-shadow: var(--hd-shadow-sm);
}

.kb-sidebar h5 {
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hd-gray-700);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--hd-primary-light);
    font-weight: 600;
}

.kb-sidebar h5 i {
    color: var(--hd-primary);
    margin-right: 0.5rem;
}

.kb-sidebar .list-group-item {
    border: none;
    padding: 0.75rem 0;
    background: transparent;
    border-bottom: 1px solid var(--hd-gray-100);
}

.kb-sidebar .list-group-item:last-child {
    border-bottom: none;
}

.kb-sidebar .list-group-item a {
    color: var(--hd-gray-700);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--hd-transition-fast);
    font-weight: 500;
}

.kb-sidebar .list-group-item a:hover {
    color: var(--hd-primary);
    padding-left: 0.5rem;
}

.kb-sidebar .list-group-item small {
    color: var(--hd-gray-500);
}

.category-badge {
    background: var(--hd-primary-light);
    color: var(--hd-primary-dark);
    padding: 0.25rem 0.75rem;
    border-radius: var(--hd-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

/* ============================================================================
   Create/Edit Ticket Form
   ============================================================================ */
#ticketForm .card {
    max-width: 800px;
    margin: 0 auto;
}

#ticketForm .card-header {
    font-size: 1.125rem;
}

#ticketForm .mb-3 {
    margin-bottom: 1.25rem !important;
}

/* ============================================================================
   Mobile Responsive Enhancements
   ============================================================================ */
@media (max-width: 992px) {
    .ticket-info {
        margin-top: 1rem;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 0 10px 30px;
    }

    .d-flex.gap-2 {
        flex-direction: column;
        gap: 0.5rem !important;
    }

    .d-flex.gap-2 .btn {
        width: 100%;
        justify-content: center;
    }

    .table thead th {
        padding: 0.75rem 0.5rem;
        font-size: 0.6875rem;
    }

    .table tbody td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }

    .stat-card {
        margin-bottom: 1rem;
    }

    .stat-card h2 {
        font-size: 2rem;
    }

    .ticket-info .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .card-header {
        padding: 0.875rem 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Hide less important columns on mobile */
    .table th:nth-child(4),
    .table td:nth-child(4),
    .table th:nth-child(5),
    .table td:nth-child(5) {
        display: none;
    }
}

@media (max-width: 768px) {
    .kb-container .row {
        flex-direction: column;
    }

    .kb-container .col-md-8,
    .kb-container .col-md-4 {
        width: 100%;
        max-width: 100%;
    }

    .kb-sidebar {
        margin-top: 1.5rem;
    }

    .kb-article-card {
        padding: 1.25rem;
    }
}

@media (max-width: 576px) {
    .kb-header {
        padding: 2rem 1rem 1.75rem;
        margin-bottom: 1.5rem;
    }

    .kb-header-icon {
        width: 64px;
        height: 64px;
        margin-bottom: 1rem;
    }

    .kb-header-icon i {
        font-size: 1.75rem;
    }

    .kb-header h1 {
        font-size: 1.5rem;
    }

    .kb-header p {
        font-size: 0.9rem;
        margin-bottom: 1.25rem;
    }

    .kb-search .input-group .input-group-text {
        padding-left: 1rem;
    }

    .kb-search .input-group .form-control {
        padding: 0.875rem 0.5rem;
        font-size: 0.9rem;
    }

    .kb-search .input-group .btn,
    .kb-search .input-group .btn.btn-light {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }

    .kb-header-hints {
        margin-top: 1rem;
    }

    .kb-header-hints span {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    .kb-article-card {
        padding: 1rem;
    }

    .kb-article-card h5 a {
        font-size: 1rem;
    }

    .kb-sidebar {
        padding: 1rem;
    }

    .replies .card-header {
        font-size: 0.8125rem;
    }

    .badge {
        padding: 0.25rem 0.5rem;
        font-size: 0.6875rem;
    }
}

/* ============================================================================
   Accessibility Enhancements
   ============================================================================ */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
a:focus-visible {
    outline: 3px solid var(--hd-primary);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--hd-gray-800);
    }

    .btn {
        border: 2px solid currentColor;
    }

    .badge {
        border: 1px solid currentColor;
    }
}

/* ============================================================================
   Print Styles
   ============================================================================ */
@media print {
    .menu,
    .btn,
    #reply,
    .search,
    #loadmore {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .content {
        max-width: 100%;
    }
}

/* ============================================================================
   Page Header
   ============================================================================ */
.page-header {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--hd-gray-200);
}

.page-header h4 {
    margin-bottom: 0;
}

.page-header p {
    margin-bottom: 0;
}

/* ============================================================================
   Filter Panel
   ============================================================================ */
.filter-panel {
    background: white;
    border-radius: var(--hd-radius-xl);
}

.filter-panel .card-body {
    padding: 1.5rem;
}

/* Button group for filters */
.btn-group .btn-check:checked + .btn-outline-secondary {
    background: var(--hd-gray-700);
    border-color: var(--hd-gray-700);
    color: white;
}

.btn-group .btn-check:checked + .btn-outline-success {
    background: var(--hd-success);
    border-color: var(--hd-success);
    color: white;
}

/* ============================================================================
   Breadcrumb Navigation
   ============================================================================ */
.breadcrumb {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: var(--hd-radius-lg);
    box-shadow: var(--hd-shadow-xs);
    border: 1px solid var(--hd-gray-200);
}

.breadcrumb-item a {
    color: var(--hd-primary);
    text-decoration: none;
    transition: color var(--hd-transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--hd-primary-dark);
}

.breadcrumb-item.active {
    color: var(--hd-gray-600);
}

/* ============================================================================
   Reply Section Enhancements
   ============================================================================ */
.reply-section .card {
    border-radius: var(--hd-radius-xl);
    overflow: hidden;
}

.replies-section {
    margin-top: 2rem;
}

.reply-card {
    margin-bottom: 1rem;
    border-radius: var(--hd-radius-lg) !important;
    border-left: 4px solid var(--hd-gray-300) !important;
    transition: all var(--hd-transition-fast);
}

.reply-card:hover {
    border-left-color: var(--hd-primary) !important;
    box-shadow: var(--hd-shadow-md);
}

.reply-card.admin-reply {
    border-left-color: var(--hd-success) !important;
    background: linear-gradient(135deg, #f0fdf4 0%, white 100%);
}

.reply-card.user-reply {
    border-left-color: var(--hd-info) !important;
}

.reply-author {
    font-weight: 500;
    color: var(--hd-gray-700);
}

.reply-meta {
    font-size: 0.875rem;
}

/* ============================================================================
   Knowledge Base Article Full View
   ============================================================================ */
.kb-article-full {
    background: white;
    border-radius: var(--hd-radius-xl);
    padding: 2rem;
    box-shadow: var(--hd-shadow-sm);
    border: 1px solid var(--hd-gray-200);
}

.kb-article-full h3 {
    color: var(--hd-gray-800);
    margin-bottom: 1rem;
}

.kb-article-full .article-meta {
    color: var(--hd-gray-500);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--hd-gray-200);
}

.kb-article-full .article-content {
    line-height: 1.8;
    color: var(--hd-gray-700);
}

.kb-article-full .article-content h1,
.kb-article-full .article-content h2,
.kb-article-full .article-content h3 {
    color: var(--hd-gray-800);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.kb-article-full .article-content code {
    background: var(--hd-gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: var(--hd-radius-sm);
    font-size: 0.875em;
}

.kb-article-full .article-content pre {
    background: var(--hd-gray-100);
    padding: 1rem;
    border-radius: var(--hd-radius-md);
    overflow-x: auto;
}

/* KB Admin Panel */
.kb-admin-panel {
    background: var(--hd-warning-light);
    border: 1px solid var(--hd-warning);
    border-radius: var(--hd-radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

/* ============================================================================
   Knowledge Base - Category Cards
   ============================================================================ */
.kb-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: white;
    border-radius: var(--hd-radius-xl);
    padding: 1.5rem 1rem;
    border: 1px solid var(--hd-gray-200);
    text-decoration: none;
    transition: all var(--hd-transition-normal);
    height: 100%;
}

.kb-category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hd-shadow-lg);
    text-decoration: none;
}

.kb-category-card.kb-category-primary:hover {
    border-color: var(--hd-primary);
}

.kb-category-card.kb-category-success:hover {
    border-color: var(--hd-success);
}

.kb-category-card.kb-category-info:hover {
    border-color: var(--hd-info);
}

.kb-category-card.kb-category-warning:hover {
    border-color: var(--hd-warning);
}

.kb-category-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--hd-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.kb-category-icon i {
    font-size: 1.5rem;
    color: white;
}

.kb-category-icon.bg-primary {
    background: linear-gradient(135deg, var(--hd-primary) 0%, var(--hd-primary-dark) 100%);
}

.kb-category-icon.bg-success {
    background: linear-gradient(135deg, var(--hd-success) 0%, #059669 100%);
}

.kb-category-icon.bg-info {
    background: linear-gradient(135deg, var(--hd-info) 0%, #0284c7 100%);
}

.kb-category-icon.bg-warning {
    background: linear-gradient(135deg, var(--hd-warning) 0%, #d97706 100%);
}

.kb-category-card h6 {
    color: var(--hd-gray-800);
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

.kb-category-count {
    color: var(--hd-gray-500);
    font-size: 0.8125rem;
}

/* ============================================================================
   Knowledge Base - Quick Filter Pills
   ============================================================================ */
.kb-quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border-radius: var(--hd-radius-xl);
    border: 1px solid var(--hd-gray-200);
}

.kb-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: var(--hd-radius-full);
    background: var(--hd-gray-100);
    color: var(--hd-gray-700);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--hd-transition-fast);
}

.kb-filter-pill:hover {
    background: var(--hd-gray-200);
    color: var(--hd-gray-800);
    text-decoration: none;
}

.kb-filter-pill.active {
    background: var(--hd-primary);
    color: white;
}

.kb-filter-pill.active:hover {
    background: var(--hd-primary-hover);
    color: white;
}

/* ============================================================================
   Knowledge Base - Results Header
   ============================================================================ */
.kb-results-header {
    padding: 1rem 1.25rem;
    background: white;
    border-radius: var(--hd-radius-lg);
    border: 1px solid var(--hd-gray-200);
}

.kb-results-header h5 {
    margin-bottom: 0.25rem;
    color: var(--hd-gray-800);
}

.kb-results-header h5 i {
    color: var(--hd-primary);
    margin-right: 0.5rem;
}

/* ============================================================================
   Knowledge Base - Enhanced Article Cards
   ============================================================================ */
.kb-article-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.kb-article-content {
    flex: 1;
}

.kb-article-card h5 {
    margin-bottom: 0.5rem;
}

.kb-article-card h5 a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kb-article-arrow {
    font-size: 0.75rem;
    opacity: 0;
    transition: all var(--hd-transition-fast);
    transform: translateX(-5px);
}

.kb-article-card:hover .kb-article-arrow {
    opacity: 1;
    transform: translateX(0);
}

.kb-article-excerpt {
    color: var(--hd-gray-600);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.kb-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.kb-article-views,
.kb-article-date {
    color: var(--hd-gray-500);
    font-size: 0.8125rem;
}

.kb-article-views i,
.kb-article-date i {
    margin-right: 0.25rem;
}

.kb-article-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ============================================================================
   Knowledge Base - Empty State
   ============================================================================ */
.kb-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--hd-radius-xl);
    border: 1px solid var(--hd-gray-200);
}

.kb-empty-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    background: var(--hd-gray-100);
    border-radius: var(--hd-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kb-empty-icon i {
    font-size: 2.5rem;
    color: var(--hd-gray-400);
}

.kb-empty-state h4 {
    color: var(--hd-gray-800);
    margin-bottom: 0.5rem;
}

.kb-empty-state p {
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

.kb-empty-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================================
   Knowledge Base - Sidebar Enhancements
   ============================================================================ */
.kb-sidebar .list-group-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kb-sidebar .list-group-item.active {
    background: var(--hd-primary-light);
    border-radius: var(--hd-radius-md);
    margin: 0 -0.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

.kb-sidebar .list-group-item.active a {
    color: var(--hd-primary-dark);
    font-weight: 600;
}

.kb-sidebar-count {
    background: var(--hd-gray-200);
    color: var(--hd-gray-600);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: var(--hd-radius-full);
    margin-left: auto;
}

.kb-sidebar .list-group-item.active .kb-sidebar-count {
    background: var(--hd-primary);
    color: white;
}

/* ============================================================================
   Knowledge Base - CTA Card
   ============================================================================ */
.kb-cta-card {
    background: linear-gradient(135deg, var(--hd-primary) 0%, var(--hd-primary-dark) 100%);
    border-radius: var(--hd-radius-xl);
    padding: 1.5rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.kb-cta-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.kb-cta-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--hd-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kb-cta-icon i {
    font-size: 1.5rem;
    color: white;
}

.kb-cta-card h6 {
    color: white;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.kb-cta-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.kb-cta-card .btn {
    background: white;
    color: var(--hd-primary-dark);
    border: none;
}

.kb-cta-card .btn:hover {
    background: var(--hd-gray-100);
    color: var(--hd-primary-dark);
}

/* Knowledge Base Breadcrumb */
.kb-breadcrumb {
    margin-bottom: 1rem;
}

.kb-breadcrumb .breadcrumb {
    background: white;
    border-radius: var(--hd-radius-lg);
    padding: 0.75rem 1.25rem;
    margin-bottom: 0;
    border: 1px solid var(--hd-gray-200);
    font-size: 0.875rem;
}

.kb-breadcrumb .breadcrumb-item a {
    color: var(--hd-gray-600);
    text-decoration: none;
    transition: color var(--hd-transition-fast);
}

.kb-breadcrumb .breadcrumb-item a:hover {
    color: var(--hd-primary);
}

.kb-breadcrumb .breadcrumb-item a i {
    margin-right: 0.375rem;
}

.kb-breadcrumb .breadcrumb-item.active {
    color: var(--hd-gray-800);
    font-weight: 500;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kb-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: var(--hd-gray-400);
    content: "›";
    font-weight: 600;
}

/* Knowledge Base Pagination */
.kb-pagination {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--hd-gray-200);
}

.kb-pagination .pagination {
    margin-bottom: 0.75rem;
    gap: 0.25rem;
}

.kb-pagination .page-item .page-link {
    border: none;
    border-radius: var(--hd-radius-md);
    padding: 0.5rem 0.875rem;
    color: var(--hd-gray-600);
    background: var(--hd-gray-100);
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.kb-pagination .page-item .page-link:hover {
    background: var(--hd-primary);
    color: white;
}

.kb-pagination .page-item.active .page-link {
    background: var(--hd-primary);
    color: white;
}

.kb-pagination .page-item.disabled .page-link {
    background: var(--hd-gray-100);
    color: var(--hd-gray-400);
    cursor: not-allowed;
}

.kb-pagination-info {
    color: var(--hd-gray-500);
}

/* ============================================================================
   Knowledge Base - Mobile Responsive
   ============================================================================ */
@media (max-width: 768px) {
    .kb-breadcrumb .breadcrumb {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    .kb-breadcrumb .breadcrumb-item.active {
        max-width: 150px;
    }

    .kb-category-card {
        padding: 1rem 0.75rem;
    }

    .kb-category-icon {
        width: 50px;
        height: 50px;
    }

    .kb-category-icon i {
        font-size: 1.25rem;
    }

    .kb-category-card h6 {
        font-size: 0.8125rem;
    }

    .kb-quick-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .kb-filter-pill {
        white-space: nowrap;
    }

    .kb-article-card {
        flex-direction: column;
    }

    .kb-article-actions {
        margin-top: 0.75rem;
    }

    .kb-empty-state {
        padding: 2.5rem 1.5rem;
    }

    .kb-empty-icon {
        width: 80px;
        height: 80px;
    }

    .kb-empty-icon i {
        font-size: 2rem;
    }

    .kb-pagination .page-item .page-link {
        padding: 0.4rem 0.65rem;
        min-width: 36px;
        font-size: 0.875rem;
    }
}

/* ============================================================================
   Spinner Utilities
   ============================================================================ */
.spinner-border.d-none {
    display: none !important;
}

.search-spinner {
    margin-left: 0.5rem;
}

/* ============================================================================
   Helpdesk Navigation
   ============================================================================ */
.helpdesk-nav {
    background: white;
    padding: 1rem;
    border-radius: var(--hd-radius-xl);
    box-shadow: var(--hd-shadow-sm);
    border: 1px solid var(--hd-gray-200);
}

.nav-pills-wrapper .btn {
    border-radius: var(--hd-radius-full);
    padding: 0.5rem 1.25rem;
    font-weight: 500;
}

.nav-pills-wrapper .btn i {
    margin-right: 0.375rem;
}

/* ============================================================================
   Settings Panel
   ============================================================================ */
.settings-panel {
    background: var(--hd-gray-50);
    border: 1px solid var(--hd-gray-200);
    position: sticky;
    top: 1rem;
}

.settings-panel h6 {
    color: var(--hd-gray-700);
    font-weight: 600;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--hd-gray-200);
}

/* External User Fields */
.external-user-fields {
    background: var(--hd-info-light);
    border: 1px solid var(--hd-info);
}

.external-user-fields h6 {
    color: var(--hd-gray-700);
    font-weight: 600;
}

/* ============================================================================
   Text Utilities
   ============================================================================ */
.text-primary {
    color: var(--hd-primary) !important;
}

.text-muted {
    color: var(--hd-gray-500) !important;
}

.text-danger {
    color: var(--hd-danger) !important;
}

/* ============================================================================
   Dark Mode Support (future-proofing)
   ============================================================================ */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here when needed */
}

/* Font Awesome Icon Visibility */
.fa-solid, .fa-regular, .fa-brands { display: inline-block; line-height: 1; }
.btn i.fa-solid, .btn i.fa-regular { margin-right: 0.35em; }

/* Public Support Page - Icon Color Contrast Fixes */
.bg-primary.bg-opacity-10 i.fa-solid { color: var(--hd-primary-dark) !important; }
.bg-warning.bg-opacity-10 i.fa-solid { color: #92400e !important; }
.bg-info.bg-opacity-10 i.fa-solid { color: #0369a1 !important; }
.bg-success.bg-opacity-10 i.fa-solid { color: #047857 !important; }
.bg-danger.bg-opacity-10 i.fa-solid { color: #b91c1c !important; }

/* Ensure text-* utility classes have sufficient contrast */
.text-primary { color: var(--hd-primary-dark) !important; }
.text-warning { color: #b45309 !important; }
.text-info { color: #0369a1 !important; }
.text-success { color: #047857 !important; }

/* ============================================================================
   Analytics Button - Custom styling with good contrast
   ============================================================================ */
.btn-analytics {
    background: transparent;
    border: 2px solid #7c3aed;
    color: #7c3aed;
    font-weight: 500;
}

.btn-analytics:hover {
    background: #7c3aed;
    border-color: #7c3aed;
    color: white;
}

.btn-analytics.active,
.btn-analytics:active {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    border-color: #7c3aed;
    color: white;
}
