/* Email Blaster System Styles */

/* General Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 48px);
    padding-top: .5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #007bff;
}

.sidebar-heading {
    font-size: .75rem;
    text-transform: uppercase;
}

/* Dashboard Cards */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Tables */
.table-responsive {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

/* Forms */
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
}

.form-control:focus, .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #004085;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
}

/* Pagination */
.pagination {
    margin-bottom: 0;
}

.page-link {
    color: #007bff;
    border-radius: 6px !important;
    margin: 0 2px;
}

.page-link:hover {
    color: #0056b3;
}

/* Badges */
.badge {
    font-size: 0.75em;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 5rem auto;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 10px;
}

/* Template Editor */
.template-editor {
    min-height: 300px;
}

/* Email Preview */
.email-preview {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
}

/* Queue Status */
.queue-status .card {
    transition: transform 0.2s;
}

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

/* Responsive Design */
@media (max-width: 767.98px) {
    .sidebar {
        position: static;
        height: auto;
    }

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

    .d-flex.justify-content-between {
        flex-direction: column;
        align-items: stretch !important;
    }

    .btn-toolbar {
        margin-top: 1rem;
    }
}

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

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #212529;
        color: #ffffff;
    }

    .card {
        background-color: #343a40;
        color: #ffffff;
    }

    .card-header {
        background-color: #495057;
        color: #ffffff;
    }

    .table {
        color: #ffffff;
    }

    .form-control {
        background-color: #495057;
        border-color: #6c757d;
        color: #ffffff;
    }

    .form-control:focus {
        background-color: #495057;
        color: #ffffff;
    }
}

/* Print Styles */
@media print {
    .sidebar, .btn, .alert, .pagination {
        display: none !important;
    }

    .container-fluid {
        margin: 0;
        padding: 0;
    }

    .table-responsive {
        box-shadow: none;
    }
}

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

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

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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