/* Zmails - Email Ticket Management System */

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    transform: translateY(-2px);
}

.navbar-nav .nav-link.active {
    font-weight: bold;
    border-bottom: 2px solid #fff;
}

/* Main Content */
#content-area {
    flex: 1;
    padding-bottom: 2rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    font-weight: bold;
}

/* Dashboard */
.stat-card {
    border-left: 4px solid;
}

.stat-card.primary {
    border-left-color: #0d6efd;
}

.stat-card.success {
    border-left-color: #198754;
}

.stat-card.warning {
    border-left-color: #ffc107;
}

.stat-card.danger {
    border-left-color: #dc3545;
}

.stat-card.info {
    border-left-color: #0dcaf0;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Email List */
.email-item {
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
    transition: background-color 0.2s ease;
}

.email-item:hover {
    background-color: #f8f9fa;
}

.email-item.unread {
    font-weight: bold;
    background-color: #f0f7ff;
}

.email-item .email-sender {
    font-weight: bold;
    color: #495057;
}

.email-item .email-subject {
    color: #212529;
    margin: 0.25rem 0;
}

.email-item .email-preview {
    color: #6c757d;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-item .email-date {
    color: #6c757d;
    font-size: 0.8rem;
}

.email-item .email-actions {
    visibility: hidden;
}

.email-item:hover .email-actions {
    visibility: visible;
}

/* Ticket List */
.ticket-item {
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
    transition: background-color 0.2s ease;
}

.ticket-item:hover {
    background-color: #f8f9fa;
}

.ticket-item .ticket-id {
    font-weight: bold;
    color: #6c757d;
}

.ticket-item .ticket-subject {
    color: #212529;
    margin: 0.25rem 0;
}

.ticket-item .ticket-status {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.ticket-item .ticket-status.open {
    background-color: #d1ecf1;
    color: #0c5460;
}

.ticket-item .ticket-status.in-progress {
    background-color: #fff3cd;
    color: #856404;
}

.ticket-item .ticket-status.pending {
    background-color: #e2e3e5;
    color: #383d41;
}

.ticket-item .ticket-status.resolved {
    background-color: #d4edda;
    color: #155724;
}

.ticket-item .ticket-status.closed {
    background-color: #f8d7da;
    color: #721c24;
}

.ticket-item .ticket-priority {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.ticket-item .ticket-priority.low {
    background-color: #d4edda;
    color: #155724;
}

.ticket-item .ticket-priority.medium {
    background-color: #fff3cd;
    color: #856404;
}

.ticket-item .ticket-priority.high {
    background-color: #f8d7da;
    color: #721c24;
}

.ticket-item .ticket-priority.urgent {
    background-color: #f5c6cb;
    color: #721c24;
}

/* AI Assistant */
.ai-analysis-card {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.ai-analysis-card .ai-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.ai-analysis-card .ai-header .ai-icon {
    font-size: 1.5rem;
    color: #0d6efd;
    margin-right: 0.5rem;
}

.ai-analysis-card .ai-header .ai-title {
    font-weight: bold;
    margin: 0;
}

.ai-analysis-card .ai-content {
    background-color: #fff;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #dee2e6;
}

.ai-suggestion-card {
    background-color: #f0f7ff;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #0d6efd;
}

.ai-suggestion-card .ai-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.ai-suggestion-card .ai-header .ai-icon {
    font-size: 1.5rem;
    color: #0d6efd;
    margin-right: 0.5rem;
}

.ai-suggestion-card .ai-header .ai-title {
    font-weight: bold;
    margin: 0;
}

.ai-suggestion-card .ai-content {
    background-color: #fff;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #dee2e6;
}

.ai-suggestion-card .ai-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

/* Forms */
.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-outline-primary {
    color: #0d6efd;
    border-color: #0d6efd;
}

.btn-outline-primary:hover {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: bold;
    color: #495057;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Modals */
.modal-content {
    border-radius: 10px;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-header {
    border-bottom: 1px solid #eee;
    background-color: #f8f9fa;
    border-radius: 10px 10px 0 0;
}

.modal-footer {
    border-top: 1px solid #eee;
    background-color: #f8f9fa;
    border-radius: 0 0 10px 10px;
}

/* Pagination */
.pagination .page-link {
    color: #0d6efd;
    border-radius: 4px;
    margin: 0 2px;
}

.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* Toasts */
.toast {
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.toast-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.toast-success {
    background-color: #d4edda;
    color: #155724;
}

.toast-error {
    background-color: #f8d7da;
    color: #721c24;
}

.toast-warning {
    background-color: #fff3cd;
    color: #856404;
}

.toast-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Loading Spinner */
#loading-spinner {
    z-index: 9999;
}

/* Footer */
footer {
    margin-top: auto;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

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

.cursor-pointer {
    cursor: pointer;
}

.transition-all {
    transition: all 0.3s ease;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.slide-in {
    animation: slideIn 0.5s ease-in-out;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
        color: #e0e0e0;
    }
    
    .card {
        background-color: #1e1e1e;
        color: #e0e0e0;
    }
    
    .card-header {
        background-color: #2c2c2c;
        border-bottom: 1px solid #444;
    }
    
    .table {
        color: #e0e0e0;
    }
    
    .table th {
        color: #e0e0e0;
        border-color: #444;
    }
    
    .table td, .table th {
        border-color: #444;
    }
    
    .form-control {
        background-color: #2c2c2c;
        color: #e0e0e0;
        border-color: #444;
    }
    
    .form-control:focus {
        background-color: #2c2c2c;
        color: #e0e0e0;
        border-color: #0d6efd;
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    }
    
    .modal-content {
        background-color: #1e1e1e;
        color: #e0e0e0;
    }
    
    .modal-header, .modal-footer {
        background-color: #2c2c2c;
        border-color: #444;
    }
    
    .navbar-dark .navbar-nav .nav-link {
        color: rgba(255, 255, 255, 0.8);
    }
    
    .navbar-dark .navbar-nav .nav-link:hover {
        color: #fff;
    }
    
    .dropdown-menu {
        background-color: #2c2c2c;
        color: #e0e0e0;
    }
    
    .dropdown-item {
        color: #e0e0e0;
    }
    
    .dropdown-item:hover {
        background-color: #3c3c3c;
        color: #fff;
    }
}