/* TicketIQ Web Application Styles */

:root {
    --sidebar-width: 250px;
    --topbar-height: 60px;
    --primary-color: #0d6efd;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.collapsed {
    width: 0;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h5 {
    color: var(--sidebar-active);
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s ease;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-active);
}

.sidebar-nav .nav-link.active {
    background: var(--primary-color);
    color: var(--sidebar-active);
}

.sidebar-nav .nav-link i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.sidebar-nav .nav-divider {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.5rem;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: #f1f5f9;
    transition: all 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
}

/* Topbar */
.topbar {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    height: var(--topbar-height);
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    z-index: 100;
}

.sidebar-toggle {
    font-size: 1.5rem;
    color: #64748b;
    padding: 0;
}

.sidebar-toggle:hover {
    color: #1e293b;
}

/* Content Wrapper */
.content-wrapper {
    padding: 1.5rem;
}

/* Cards */
.card {
    border-radius: 0.5rem;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.25rem;
}

/* Tables */
.table th {
    font-weight: 600;
    color: #475569;
    border-bottom-width: 2px;
}

.table td {
    vertical-align: middle;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Ticket Item */
.ticket-item {
    transition: background 0.2s ease;
}

.ticket-item:hover {
    background: #f8fafc;
}

/* Comments */
.comment {
    transition: all 0.2s ease;
}

.comment:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Toast */
.toast {
    border: none;
    border-radius: 0.375rem;
}

/* Charts */
canvas {
    max-width: 100%;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        overflow: hidden;
    }

    .sidebar.show {
        width: var(--sidebar-width);
    }

    .main-content {
        margin-left: 0;
    }
}

/* Utilities */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Login Page Specific */
body.bg-light {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    min-height: 100vh;
}

body.bg-light .card {
    border-radius: 1rem;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}

/* Chat Bot Styles */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #6c757d;
    border-radius: 50%;
    animation: typing 1s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

.chat-message {
    word-wrap: break-word;
}

.chat-message pre {
    margin: 0.5rem 0;
    font-size: 0.85rem;
    overflow-x: auto;
}

.chat-message code {
    font-size: 0.85rem;
}

.chat-content ol,
.chat-content ul {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
}
