/* =====================
   SMS Blast MVP - Styles
   ===================== */

/* --- Skip to Content (Accessibility) --- */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    padding: 0.75rem 1.5rem;
    background: #0d6efd;
    color: #fff;
    border-radius: 0 0 0.5rem 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-to-content:focus {
    top: 0;
    color: #fff;
}

/* --- Focus Visible (Accessibility) --- */
*:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

/* --- Message Thread Styles --- */
.thread .msg-out .border { 
    background: #e7f1ff !important; 
    border-left: 3px solid #0d6efd;
}
.thread .msg-in .border { 
    background: #f7f7f7 !important; 
    border-left: 3px solid #6c757d;
}

/* --- Sidebar Navigation --- */
.sidebar {
    min-height: calc(100vh - 56px);
    background: linear-gradient(180deg, #f8f9fa 0%, #f0f2f5 100%);
    border-right: 1px solid #dee2e6;
}

.sidebar .nav-link {
    color: #495057;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.125rem;
    transition: all 0.15s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.sidebar .nav-link:hover {
    background-color: rgba(13, 110, 253, 0.08);
    color: #0d6efd;
    transform: translateX(2px);
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
    color: white;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 8px;
    text-align: center;
    font-size: 0.85rem;
}

/* --- Stats Cards --- */
.stat-card {
    border-left: 4px solid;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-card.primary { border-left-color: #0d6efd; }
.stat-card.success { border-left-color: #198754; }
.stat-card.warning { border-left-color: #ffc107; }
.stat-card.danger  { border-left-color: #dc3545; }
.stat-card.info    { border-left-color: #0dcaf0; }

/* --- Tables --- */
.table-hover tbody tr {
    transition: background-color 0.15s;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.03);
}

.table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
    font-weight: 600;
}

/* --- Badges --- */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
}

/* --- Campaign Status --- */
.status-draft      { background-color: #6c757d; }
.status-running    { background-color: #0d6efd; }
.status-paused     { background-color: #ffc107; color: #000; }
.status-completed  { background-color: #198754; }
.status-blocked,
.status-stopped    { background-color: #dc3545; }

/* --- Conversation Status Badges --- */
.conv-waiting {
    background-color: #6c757d;
    color: white;
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.conv-replied {
    background-color: #198754;
    color: white;
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.conv-stop {
    background-color: #dc3545;
    color: white;
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
}

/* --- Forms --- */
.form-label {
    font-weight: 500;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.form-control,
.form-select {
    border-radius: 0.5rem;
}

/* --- Buttons --- */
.btn {
    font-weight: 500;
    transition: all 0.15s ease;
    border-radius: 0.5rem;
}

/* Only lift primary CTA buttons, not every tiny icon button */
.btn-primary:hover,
.btn-success:hover,
.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Destructive buttons get extra spacing when in button groups */
.btn-group-separated .btn-outline-danger,
.d-flex .btn-outline-danger:last-child {
    margin-left: 0.25rem;
}

/* --- Page Header --- */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
}

.page-header h1 {
    margin: 0;
    font-weight: 600;
}

/* --- Cards --- */
.card {
    border: none;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    border-radius: 0.75rem;
    transition: box-shadow 0.2s;
}

/* Only interactive cards lift on hover */
.card-interactive:hover,
.stat-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    border-radius: 0.75rem 0.75rem 0 0 !important;
}

/* --- Breadcrumbs --- */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #0d6efd;
}

.breadcrumb-item.active {
    color: #495057;
    font-weight: 500;
}

/* --- Empty States --- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #adb5bd;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* --- Loading States --- */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }

    .table th,
    .table td {
        font-size: 0.8rem;
        padding: 0.4rem;
    }
}

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

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

/* --- Charts --- */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 2rem;
}

/* --- File Upload --- */
.file-upload-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-upload-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
}

/* --- Toast Notifications --- */
.toast {
    min-width: 300px;
    border-radius: 0.75rem;
}

/* --- Progress Bars --- */
.progress {
    height: 1.5rem;
    border-radius: 0.5rem;
}

.progress-bar {
    font-weight: 500;
}

/* --- Action Dropdown (contacts etc.) --- */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border-radius: 0.5rem;
    padding: 0.5rem;
}

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

.dropdown-item:hover {
    background-color: rgba(13, 110, 253, 0.08);
}

.dropdown-divider {
    margin: 0.25rem 0;
}

/* --- Windowed Pagination --- */
.pagination .page-link {
    border-radius: 0.375rem !important;
    margin: 0 2px;
    border: none;
    color: #495057;
    font-size: 0.85rem;
    min-width: 2rem;
    text-align: center;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
}

.pagination .page-item.disabled .page-link {
    color: #c0c0c0;
}

