/* Custom styles for EmailGenie */

/* Global styles */
:root {
    --emailgenie-primary: #0066cc;
    --emailgenie-secondary: #6c757d;
    --emailgenie-success: #28a745;
    --emailgenie-danger: #dc3545;
    --emailgenie-warning: #ffc107;
    --emailgenie-info: #17a2b8;
}

/* Body and layout */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

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

.navbar-brand i {
    margin-right: 0.5rem;
    color: #fff;
}

/* Card enhancements */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: var(--bs-gray-100);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* Button enhancements */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.btn i {
    margin-right: 0.25rem;
}

.btn-group .btn i {
    margin-right: 0;
}

/* Form enhancements */
.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--emailgenie-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

/* Table enhancements */
.table {
    border-radius: 0.375rem;
    overflow: hidden;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

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

/* Badge enhancements */
.badge {
    font-size: 0.75em;
    font-weight: 500;
}

.badge i {
    margin-right: 0.25rem;
}

/* Progress bar enhancements */
.progress {
    height: 0.5rem;
    border-radius: 0.25rem;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: inherit;
    transition: width 0.6s ease;
}

/* Toast enhancements */
.toast {
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.toast-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Modal enhancements */
.modal-content {
    border-radius: 0.5rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Loading states */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

.loading .btn {
    position: relative;
}

.loading .btn::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* File upload area */
.file-upload-area {
    border: 2px dashed #ced4da;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.15s ease-in-out, background-color 0.15s ease-in-out;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--emailgenie-primary);
    background-color: rgba(0, 102, 204, 0.05);
}

.file-upload-area.dragover {
    border-color: var(--emailgenie-success);
    background-color: rgba(40, 167, 69, 0.05);
}

/* Statistics cards */
.stats-card {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary) 100%);
    color: white;
    border: none;
    transition: transform 0.2s ease-in-out;
}

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

.stats-number {
    font-size: 2.5rem;
    font-weight: bold;
    line-height: 1;
}

/* Status indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-indicator.status-sent {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--emailgenie-success);
}

.status-indicator.status-failed {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--emailgenie-danger);
}

.status-indicator.status-pending {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--emailgenie-warning);
}

/* Responsive enhancements */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-group .btn {
        padding: 0.375rem 0.5rem;
    }
    
    .stats-number {
        font-size: 2rem;
    }
}

/* Dark mode specific enhancements */
[data-bs-theme="dark"] .card {
    background-color: var(--bs-dark);
    border-color: var(--bs-gray-700);
}

[data-bs-theme="dark"] .card-header {
    background-color: var(--bs-gray-800);
    border-color: var(--bs-gray-700);
}

[data-bs-theme="dark"] .table {
    color: var(--bs-gray-100);
}

[data-bs-theme="dark"] .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.075);
}

[data-bs-theme="dark"] .file-upload-area {
    border-color: var(--bs-gray-600);
    background-color: var(--bs-gray-800);
}

[data-bs-theme="dark"] .file-upload-area:hover {
    border-color: var(--emailgenie-primary);
    background-color: rgba(0, 102, 204, 0.1);
}

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

.cursor-pointer {
    cursor: pointer;
}

.border-dashed {
    border-style: dashed !important;
}

.shadow-soft {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow-hover {
    transition: box-shadow 0.15s ease-in-out;
}

.shadow-hover:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

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

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Print styles */
@media print {
    .navbar, .btn, .pagination, .toast-container {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .table {
        border-collapse: collapse !important;
    }
    
    .table th, .table td {
        border: 1px solid #000 !important;
    }
}
