/* ============================================================
   FiberCop Delivery Messenger — Custom Styles
   ============================================================ */

/* ─────────────────────────────────────────────
   Global
   ───────────────────────────────────────────── */
:root {
    --primary: #2563eb;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-dark: #1e293b;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ─────────────────────────────────────────────
   Cards
   ───────────────────────────────────────────── */
.card {
    border-radius: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08) !important;
}

.card-body {
    padding: 1.25rem;
}

/* ─────────────────────────────────────────────
   Icons Circles
   ───────────────────────────────────────────── */
.icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─────────────────────────────────────────────
   Badges
   ───────────────────────────────────────────── */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 0.375rem;
}

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

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

.btn-success {
    background-color: var(--success);
    border-color: var(--success);
}

.btn-success:hover {
    background-color: #059669;
    border-color: #059669;
}

/* ─────────────────────────────────────────────
   Tables
   ───────────────────────────────────────────── */
.table {
    font-size: 0.875rem;
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom-width: 2px;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.04);
}

/* ─────────────────────────────────────────────
   Forms
   ───────────────────────────────────────────── */
.form-control,
.form-select {
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.input-group-text {
    border-radius: 0.5rem 0 0 0.5rem;
    background-color: var(--bg-secondary);
    border: 1px solid #e2e8f0;
    color: var(--text-secondary);
}

/* ─────────────────────────────────────────────
   Navbar
   ───────────────────────────────────────────── */
.navbar {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #0f172a 100%) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-link {
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.nav-link:hover {
    opacity: 0.85;
}

/* ─────────────────────────────────────────────
   Footer
   ───────────────────────────────────────────── */
.footer {
    border-top: 1px solid #e2e8f0;
    margin-top: 2rem;
}

/* ─────────────────────────────────────────────
   Message Timeline
   ───────────────────────────────────────────── */
.message-timeline {
    max-height: 500px;
    overflow-y: auto;
    padding: 0.5rem;
}

/* WhatsApp-style message rows */
.message-row {
    animation: slideIn 0.3s ease;
}

.message-row .badge {
    animation: none;
}

.message-row .d-inline-block {
    animation: fadeInUp 0.3s ease;
}

/* WhatsApp-style bubble for sent messages */
.message-row.outbound .d-inline-block.px-3 {
    border-bottom-right-radius: 4px !important;
}

/* WhatsApp-style bubble for received messages */
.message-row.inbound .d-inline-block.px-3 {
    border-bottom-left-radius: 4px !important;
}

/* Message status icons */
.message-status-icon {
    font-size: 0.75rem;
    vertical-align: middle;
}

/* Empty state */
.message-empty-state {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.message-empty-state i {
    opacity: 0.2;
}

/* Message counter badges in header */
.message-counter {
    font-size: 0.75rem;
    padding: 0.25em 0.5em;
}

/* Scrollbar styling for message timeline */
.message-timeline::-webkit-scrollbar {
    width: 6px;
}

.message-timeline::-webkit-scrollbar-track {
    background: transparent;
}

.message-timeline::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

.message-timeline::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* ─────────────────────────────────────────────
   Alerts
   ───────────────────────────────────────────── */
.alert {
    border-radius: 0.75rem;
    border: none;
    font-weight: 500;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
}

/* ─────────────────────────────────────────────
   Animations
   ───────────────────────────────────────────── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* ─────────────────────────────────────────────
   Responsive
   ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }

    .table {
        font-size: 0.8125rem;
    }

    .icon-circle {
        width: 40px;
        height: 40px;
    }

    .icon-circle i {
        font-size: 1.25rem !important;
    }
}

/* ─────────────────────────────────────────────
   Scrollbar
   ───────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* ─────────────────────────────────────────────
   Print
   ───────────────────────────────────────────── */
@media print {
    .navbar, .footer, .btn {
        display: none !important;
    }

    body {
        background: white;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}
