/* Smart Mail Assistant - Main Styles */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --light: #f8fafc;
    --dark: #1e293b;
    --body-bg: #f1f5f9;
}

body {
    background-color: var(--body-bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Navbar */
.navbar-brand {
    font-weight: 600;
}

.navbar .nav-link {
    font-weight: 500;
    padding: 0.75rem 1rem !important;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
}

/* Cards */
.card {
    border-radius: 0.75rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.25rem;
}

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

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--secondary);
    background-color: var(--light);
    border-bottom-width: 2px;
}

.table td {
    vertical-align: middle;
    padding: 1rem 0.75rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

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

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

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

/* Forms */
.form-control, .form-select {
    border-radius: 0.5rem;
    border-color: #e2e8f0;
    padding: 0.625rem 0.875rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-floating > label {
    padding: 0.625rem 0.875rem;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 0.375rem;
}

/* List groups */
.list-group-item {
    border-left: none;
    border-right: none;
    border-color: #f1f5f9;
}

.list-group-item:first-child {
    border-top: none;
}

.list-group-item-action:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

/* Progress bars */
.progress {
    border-radius: 1rem;
    background-color: #e2e8f0;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.75rem;
}

/* Email list specific */
.email-list-item {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.email-list-item:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

.email-list-item.unread {
    background-color: rgba(37, 99, 235, 0.03);
    border-left: 3px solid var(--primary);
}

.email-list-item.unread .email-subject {
    font-weight: 600;
}

.email-preview {
    color: var(--secondary);
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Task list specific */
.task-item {
    transition: all 0.2s ease;
}

.task-item.completed {
    opacity: 0.6;
}

.task-item.completed .task-title {
    text-decoration: line-through;
}

.task-priority-urgent {
    border-left: 4px solid var(--danger) !important;
}

.task-priority-high {
    border-left: 4px solid var(--warning) !important;
}

/* Status indicators */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background-color: var(--success);
}

.status-dot.offline {
    background-color: var(--secondary);
}

.status-dot.busy {
    background-color: var(--danger);
}

/* Category badges */
.category-order { background-color: #dbeafe; color: #1e40af; }
.category-support { background-color: #dcfce7; color: #166534; }
.category-inquiry { background-color: #fef3c7; color: #92400e; }
.category-complaint { background-color: #fee2e2; color: #991b1b; }
.category-newsletter { background-color: #e0e7ff; color: #3730a3; }
.category-spam { background-color: #f3f4f6; color: #374151; }

/* Priority badges */
.priority-urgent { background-color: #fee2e2; color: #991b1b; }
.priority-high { background-color: #fef3c7; color: #92400e; }
.priority-normal { background-color: #dbeafe; color: #1e40af; }
.priority-low { background-color: #f3f4f6; color: #374151; }

/* Sidebar */
.sidebar {
    width: 280px;
    min-height: calc(100vh - 56px);
    background-color: white;
    border-right: 1px solid #e2e8f0;
}

.sidebar .nav-link {
    color: var(--dark);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin: 0.125rem 0.5rem;
}

.sidebar .nav-link:hover {
    background-color: var(--light);
}

.sidebar .nav-link.active {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.sidebar .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 0.5rem;
}

/* Dropdown menus */
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem;
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
}

.dropdown-item:hover {
    background-color: var(--light);
}

/* Modal */
.modal-content {
    border: none;
    border-radius: 1rem;
}

.modal-header {
    border-bottom: 1px solid #f1f5f9;
}

.modal-footer {
    border-top: 1px solid #f1f5f9;
}

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

/* Loading spinner */
.spinner-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;
}

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

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

/* 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;
}

/* Print styles */
@media print {
    .navbar, .sidebar, .btn, .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #e2e8f0;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}
