/* Custom styles for Spam Detector */

body {
    background-color: #f8f9fa;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-tabs .nav-link {
    color: #495057;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: #0d6efd;
    font-weight: 600;
}

.card {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: none;
    margin-bottom: 20px;
}

.card-title {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.btn {
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.btn i {
    margin-right: 0.5rem;
}

/* Custom styles for the email table */
#emailTable {
    margin-top: 1rem;
}

#emailTable tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
}

#emailTable tbody tr:hover {
    background-color: #f1f3f5;
}

/* Enhanced status badges */
.status-badge {
    display: inline-block;
    margin: 0.25rem;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 0.25rem;
    text-transform: uppercase;
}

.status-spam {
    background-color: #dc3545;
    color: white;
}

.status-ham {
    background-color: #198754;
    color: white;
}

.status-ad {
    background-color: #ffc107;
    color: #000;
}

/* Priority status badges */
.status-high {
    background-color: #dc3545;
    color: white;
}

.status-medium {
    background-color: #fd7e14;
    color: white;
}

.status-low {
    background-color: #6c757d;
    color: white;
}

/* New badge styles for Bootstrap 5 */
.badge.bg-danger {
    background-color: #dc3545 !important;
}

.badge.bg-success {
    background-color: #198754 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.badge.bg-info {
    background-color: #0dcaf0 !important;
    color: #000 !important;
}

/* Spam deletion alert styling */
.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-warning .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.alert-warning .btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
}

/* Log container styles */
.log-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
}

.log-entry {
    padding: 0.5rem;
    border-bottom: 1px solid #dee2e6;
    font-family: monospace;
}

.log-entry:last-child {
    border-bottom: none;
}

/* Toast customization */
.toast {
    background-color: white;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.toast.bg-success {
    background-color: #198754 !important;
}

.toast.bg-danger {
    background-color: #dc3545 !important;
}

.toast.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.toast.bg-info {
    background-color: #0dcaf0 !important;
    color: #000 !important;
}

/* Form styles */
.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-text a {
    color: #6c757d;
    text-decoration: none;
}

.form-text a:hover {
    text-decoration: underline;
}

/* Email view improvements */
.modal-body pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

.email-metadata {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

.email-metadata strong {
    color: #495057;
}

/* Table improvements */
#emailTable td {
    vertical-align: middle;
}

#emailTable .text-muted {
    font-size: 0.875rem;
}

/* Enhanced table styling */
#emailTable thead th {
    background-color: #343a40;
    color: white;
    border-color: #454d55;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

#emailTable tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

#emailTable tbody tr:hover {
    background-color: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Button tooltips */
[title] {
    position: relative;
}

/* Action buttons styling */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    margin: 0.125rem;
}

.btn-outline-primary:hover {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

.btn-outline-success:hover {
    background-color: #198754;
    border-color: #198754;
    color: white;
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* Progress bar styling */
.progress {
    height: 1.5rem;
    background-color: #e9ecef;
    border-radius: 0.375rem;
    overflow: hidden;
}

.progress-bar {
    background-color: #0d6efd;
    transition: width 0.3s ease;
}

.progress-bar-striped {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
}

.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% { background-position-x: 1rem; }
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .table-responsive {
        margin: 0 -15px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .badge {
        display: inline-block;
        margin-bottom: 0.25rem;
    }
    
    #emailTable td {
        min-width: 200px;
    }
    
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .progress {
        height: 1rem;
    }
    
    .status-badge {
        font-size: 0.7em;
        padding: 0.25em 0.5em;
    }
}

/* Email count badge */
#emailCount {
    font-weight: bold;
}

/* Alert container styling */
#alertContainer {
    margin-bottom: 1rem;
}

.alert {
    border-radius: 0.375rem;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Toast container positioning */
.toast-container {
    z-index: 1055;
}

/* Form improvements */
#loginForm {
    max-width: 500px;
    margin: 0 auto;
}

.form-label {
    font-weight: 600;
    color: #495057;
}

/* Email subject styling */
.email-subject {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.email-sender {
    color: #6c757d;
    font-size: 0.875rem;
}

.email-date {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Action buttons container */
.action-buttons {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    flex: 1;
    min-width: 80px;
    margin: 0;
} 