/* ===== PIM EMAILINATOR - OVERRIDES =====
 * Additional customizations and Bootstrap overrides
 * This file is loaded after app.css but app.css takes precedence
 * for any conflicting rules
 * ===== */

/* ===== CSS Variables ===== */
:root {
    --bs-check-color: #003366;
    --pim-blue: #003366;
    --pim-blue-hover: #002244;
    --pim-gray: #2b2b2b;
    --pim-light-gray: #a0a0a0;
    --pim-complementary: #004D99;
    --pim-orange: #FFC107;
    --pim-success: #339933;
    --pim-danger: #cc0000;
}

/* ===== Bootstrap Card Defaults (Essential Spacing) ===== */
/* Restore Bootstrap's default card spacing that components expect */
.card {
    margin-bottom: 1.5rem; /* Spacing between cards */
}

.card-body {
    padding: 1.25rem; /* Bootstrap default card-body padding */
}

.card-header {
    padding: 0.75rem 1.25rem; /* Bootstrap default card-header padding */
}

/* ===== Container & Layout Spacing ===== */
.container-main {
    padding: 1.5rem;
    margin: 0 auto; /* Center horizontally; bottom spacing comes from the content below */
}

.header {
    padding: 1.5rem;
    margin-bottom: 0; /* Header is the sole child of container-main; no bottom gap needed */
}

/* ===== Additional Link Styles ===== */
a:active {
    color: var(--pim-blue-hover);
}

/* ===== List Group Overrides ===== */
.list-group-item-action.active {
    background-color: var(--pim-blue) !important;
    border-color: var(--pim-blue) !important;
    color: white !important;
}

.list-group-item-action:hover:not(.active) {
    background-color: var(--pim-blue-hover) !important;
    border-color: var(--pim-blue-hover) !important;
    color: white !important;
    cursor: pointer;
}

.list-group-item:hover {
    background-color: var(--pim-blue) !important;
    border-color: var(--pim-blue) !important;
    color: white;
    cursor: pointer;
}

/* ===== Dealer Card Styles (for DealerList page) ===== */
.dealer-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dealer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.2) !important;
}

.dealer-card .card-header {
    font-size: 1.1rem;
}

/* ===== Queue Status Badges ===== */
.status-queued {
    background-color: #FFC107;
    color: #2b2b2b;
}

.status-sent {
    background-color: #339933;
    color: white;
}

.status-failed {
    background-color: #cc0000;
    color: white;
}

/* ===== Service Status Widget (header badges) ===== */
.service-status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.3em 0.65em;
}

.service-status-running {
    background-color: var(--pim-success);
    color: white;
}

.service-status-stopped {
    background-color: var(--pim-danger);
    color: white;
}

.service-status-pending {
    background-color: var(--pim-orange);
    color: var(--pim-gray);
}

.service-status-paused {
    background-color: #6c757d;
    color: white;
}

.service-status-unknown {
    background-color: #6c757d;
    color: white;
}

.status-pending {
    background-color: #6c757d;
    color: white;
}

/* ===== Mode Toggle Buttons ===== */
.mode-toggle-btn {
    border: 2px solid var(--pim-blue);
    color: var(--pim-blue);
    background-color: transparent;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.mode-toggle-btn:hover:not(.active) {
    background-color: rgba(0, 51, 102, 0.08);
    color: var(--pim-blue);
    border-color: var(--pim-blue);
}

.mode-toggle-btn.active {
    background-color: var(--pim-blue);
    color: white;
    border-color: var(--pim-blue);
}

.mode-toggle-btn.active:hover {
    background-color: var(--pim-blue-hover);
    border-color: var(--pim-blue-hover);
}

/* ===== Email Type Radio Options ===== */
.form-check-label {
    font-size: 1rem;
}

.form-check-label.fw-bold {
    font-size: 1.1rem;
}

/* ===== Processing State ===== */
.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.processing-spinner {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    text-align: center;
}

/* ===== Alert Enhancements ===== */
.alert {
    border-left: 4px solid transparent;
}

.alert-info {
    border-left-color: #0c5460;
}

.alert-success {
    border-left-color: #155724;
}

.alert-warning {
    border-left-color: #856404;
}

.alert-danger {
    border-left-color: #721c24;
}

/* ===== Icon Filters (if using SVG icons) ===== */
.icon-invert {
    filter: invert();
}

.filter-icon-pim-blue {
    filter: brightness(0) saturate(100%) invert(11%) sepia(71%) saturate(3060%) hue-rotate(197deg) brightness(96%) contrast(101%);
}

.filter-icon-red {
    filter: invert(13%) sepia(51%) saturate(4284%) hue-rotate(340deg) brightness(87%) contrast(88%);
}

.filter-icon-green {
    filter: invert(60%) sepia(53%) saturate(3815%) hue-rotate(81deg) brightness(119%) contrast(123%);
}

/* ===== Small Text Utilities ===== */
.text-small {
    font-size: 0.875rem;
}

.text-muted {
    color: var(--pim-light-gray) !important;
}

/* ===== HR Styling ===== */
hr {
    border-color: #d9d9d9;
}

/* ===== Focus States for Accessibility ===== */
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    outline: none;
}

/* ===== Disabled State ===== */
.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.form-check-input:disabled,
.form-control:disabled,
.form-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #e9ecef;
}

/* ===== Dealer Search/Filter ===== */
.dealer-search-box {
    border: 2px solid var(--pim-blue);
    border-radius: 8px;
}

.dealer-search-box:focus-within {
    box-shadow: 0 0 0 0.2rem rgba(0, 51, 102, 0.25);
}

/* ===== Queue Summary Statistics ===== */
.stat-card {
    border-left: 4px solid var(--pim-blue);
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    color: var(--pim-blue);
    font-size: 2rem;
}

.stat-card p {
    color: var(--pim-gray);
    font-size: 0.9rem;
}

/* ===== Responsive Table ===== */
.table-responsive {
    border-radius: 8px;
    overflow-x: auto;
}

/* ===== Loading States ===== */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    height: 20px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    color: var(--pim-light-gray);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    opacity: 0.5;
}

.empty-state h4 {
    color: var(--pim-gray);
}

.empty-state p {
    color: var(--pim-light-gray);
}

/* ===== Scroll Shadows (for long lists) ===== */
.scrollable-list {
    max-height: 400px;
    overflow-y: auto;
    position: relative;
}

.scrollable-list::before,
.scrollable-list::after {
    content: '';
    position: sticky;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 1;
}

.scrollable-list::before {
    top: 0;
    background: linear-gradient(to bottom, white, transparent);
}

.scrollable-list::after {
    bottom: 0;
    background: linear-gradient(to top, white, transparent);
}

/* ===== Print Styles ===== */
@media print {
    .header,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    body {
        background: white !important;
    }
}

/* ===== Mobile Optimizations ===== */
@media (max-width: 640px) {
    .card-header {
        font-size: 1rem;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .form-check-label {
        font-size: 0.95rem;
    }
}