﻿/* Global color theme */
:root {
    --primary-color: #0366d6; /* Microsoft blue */
    --primary-light: #3b82f6;
    --primary-dark: #0550ae;
    --secondary-color: #384048; /* Charcoal */
    --bg-color: #ffffff;
    --text-color: #333333;
    --heading-color: #384048;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --hover-bg: #f8f9fa;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

h1 {
    font-size: 1.75rem;
    padding-bottom: 0.5rem;
}

/* Button styling */
.btn {
    border-radius: 4px;
    padding: 0.375rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Primary button - blue */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    font-weight: 500;
}

    .btn-primary:hover, .btn-primary:focus {
        background-color: var(--primary-dark);
        border-color: var(--primary-dark);
        color: #fff;
        transform: translateY(-2px);
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    }

/* Secondary button - charcoal */
.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #fff;
    font-weight: 500;
}

    .btn-secondary:hover, .btn-secondary:focus {
        background-color: #2c343a;
        border-color: #2c343a;
        color: #fff;
        transform: translateY(-2px);
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    }

/* Success button - forest green */
.btn-success {
    background-color: #2e8b57; /* Sea green */
    border-color: #2e8b57;
    color: #fff;
    font-weight: 500;
}

    .btn-success:hover, .btn-success:focus {
        background-color: #267349;
        border-color: #267349;
        transform: translateY(-2px);
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    }

/* Info button - slate blue */
.btn-info {
    background-color: #5b7f95; /* Muted blue-gray */
    border-color: #5b7f95;
    color: #fff;
    font-weight: 500;
}

    .btn-info:hover, .btn-info:focus {
        background-color: #4a697b;
        border-color: #4a697b;
        transform: translateY(-2px);
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    }

/* Warning button - amber */
.btn-warning {
    background-color: #d4a76a; /* Muted amber */
    border-color: #d4a76a;
    color: #fff;
    font-weight: 500;
}

    .btn-warning:hover, .btn-warning:focus {
        background-color: #c39355;
        border-color: #c39355;
        color: #fff;
        transform: translateY(-2px);
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    }

/* Danger button - burgundy */
.btn-danger {
    background-color: #a94442; /* Burgundy red */
    border-color: #a94442;
    color: #fff;
    font-weight: 500;
}

    .btn-danger:hover, .btn-danger:focus {
        background-color: #913a38;
        border-color: #913a38;
        transform: translateY(-2px);
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    }

/* Small buttons */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.2rem;
}

/* Card styling */
.card {
    border: none;
    border-radius: 6px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

    .card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    }

.card-header {
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
}

/* Form controls */
.form-control {
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.2s ease;
}

    .form-control:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.2rem rgba(3, 102, 214, 0.15);
    }

/* Table styling */
.table thead th {
    background-color: #f8f8f8;
    border-bottom: 2px solid #ddd;
    font-weight: 600;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(3, 102, 214, 0.03);
}

.table-hover tbody tr:hover {
    background-color: rgba(3, 102, 214, 0.05);
}

/* Badge styling */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 4px;
}

.badge-primary {
    background-color: var(--primary-color);
}

.badge-secondary {
    background-color: var(--secondary-color);
}

.badge-success {
    background-color: #2e8b57;
}

.badge-info {
    background-color: #5b7f95;
}

.badge-warning {
    background-color: #d4a76a;
}

.badge-danger {
    background-color: #a94442;
}

/* Alerts and notifications */
.alert {
    border: none;
    border-radius: 4px;
    padding: 0.75rem 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.alert-primary {
    background-color: #e8f0ff;
    color: #0550ae;
    border-left: 4px solid var(--primary-color);
}

.alert-success {
    background-color: #ebf5f0;
    color: #267349;
    border-left: 4px solid #2e8b57;
}

.alert-info {
    background-color: #edf2f5;
    color: #4a697b;
    border-left: 4px solid #5b7f95;
}

.alert-warning {
    background-color: #f8f3eb;
    color: #c39355;
    border-left: 4px solid #d4a76a;
}

.alert-danger {
    background-color: #f5ebeb;
    color: #913a38;
    border-left: 4px solid #a94442;
}

/* Navs and tabs */
.nav-tabs .nav-link {
    color: var(--text-color);
    border: none;
    padding: 0.75rem 1rem;
    margin-right: 0.5rem;
    transition: all 0.2s ease;
}

    .nav-tabs .nav-link.active {
        color: var(--primary-color);
        border-bottom: 2px solid var(--primary-color);
        font-weight: 500;
        background-color: transparent;
    }

    .nav-tabs .nav-link:hover:not(.active) {
        background-color: var(--hover-bg);
        border-bottom: 2px solid #e0e0e0;
    }

/* Progress bars */
.progress {
    height: 0.5rem;
    border-radius: 4px;
    background-color: #f0f0f0;
}

.progress-bar {
    background-color: var(--primary-color);
}

/* Utility classes */
.border-accent {
    border-left: 3px solid var(--primary-color);
    padding-left: 15px;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--secondary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-secondary {
    background-color: var(--secondary-color) !important;
}

/* Custom utility classes for spacing */
.mb-6 {
    margin-bottom: 4rem;
}

.mt-6 {
    margin-top: 4rem;
}

.py-6 {
    padding-top: 4rem;
    padding-bottom: 4rem;
}


/*Toast Notification*/
.toast-container {
    max-width: 350px;
}

.toast {
    opacity: 1 !important;
    border-left-width: 4px !important;
}

/* allow the dropdown to stick out below the edit card */
.edit-item-card,
.edit-item-card .card-body {
    overflow: visible !important;
}

/* Fix for alert close button overlap */
.alert-dismissible {
    padding-right: 3rem;
}

    .alert-dismissible .btn-close {
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
    }

/* Status toast notifications */
.status-toast {
    position: fixed;
    top: 80px; /* Move down to avoid browser toolbar */
    right: 20px;
    z-index: 1055;
    min-width: 300px;
}

    .status-toast .alert {
        position: relative;
        padding-right: 3.5rem; /* Extra padding for close button */
        margin-bottom: 0;
    }

        .status-toast .alert .btn-close {
            position: absolute;
            top: 50%;
            right: 0.75rem;
            transform: translateY(-50%);
            padding: 0.5rem;
        }

        /* Ensure the alert message text doesn't overlap with close button */
        .status-toast .alert i {
            margin-right: 0.5rem;
        }

/* ===============================
   MODAL Z-INDEX FIX
   =============================== */
/* Fix for Bootstrap modal z-index layering issues */
.modal {
    z-index: 1050 !important;
}

.modal-backdrop {
    z-index: 1040 !important;
}

.modal-dialog {
    z-index: 1060 !important;
}

/* Ensure modals are always above other content */
.modal.show {
    z-index: 1050 !important;
}

/* ===============================
   MARKDOWN ADMONITIONS
   =============================== */
/* GitHub-style admonitions/callouts */
.md-body .admonition, 
.md-body .custom-container, 
.md-body div[class*="note"],
.md-body div[class*="tip"],
.md-body div[class*="important"],
.md-body div[class*="warning"],
.md-body div[class*="caution"] { 
    border-left: .25rem solid; 
    padding: 12px 16px; 
    border-radius: 6px; 
    margin: 16px 0; 
    background: #f8f9fa; /* light bg for light theme */
    border: 1px solid #e9ecef;
}

.md-body .admonition-title, .md-body .custom-container > p:first-child {
    font-weight: 600; 
    margin: 0 0 6px 0;
}

/* Map types to colors */
.md-body .admonition.note, 
.md-body .custom-container.note,
.md-body div[class*="note"] { 
    border-left-color: #3b82f6 !important; 
    background-color: #eff6ff !important;
    border-color: #dbeafe !important;
}

.md-body .admonition.tip, 
.md-body .custom-container.tip,
.md-body div[class*="tip"] { 
    border-left-color: #22c55e !important; 
    background-color: #f0fdf4 !important;
    border-color: #dcfce7 !important;
}

.md-body .admonition.important, 
.md-body .custom-container.important,
.md-body div[class*="important"] { 
    border-left-color: #a855f7 !important; 
    background-color: #faf5ff !important;
    border-color: #f3e8ff !important;
}

.md-body .admonition.warning, 
.md-body .custom-container.warning,
.md-body div[class*="warning"] { 
    border-left-color: #f59e0b !important; 
    background-color: #fffbeb !important;
    border-color: #fed7aa !important;
}

.md-body .admonition.caution, 
.md-body .custom-container.caution,
.md-body div[class*="caution"] { 
    border-left-color: #ef4444 !important; 
    background-color: #fef2f2 !important;
    border-color: #fecaca !important;
}

/* Optional icons/titles with Bootstrap Icons - Commented out since we use SVG icons in HTML now */
/* .md-body .custom-container.note::before,
.md-body div[class*="note"]::before { 
    content: "💡 Note"; 
    color: #3b82f6;
}

.md-body .custom-container.tip::before,
.md-body div[class*="tip"]::before { 
    content: "💡 Tip"; 
    color: #22c55e;
}

.md-body .custom-container.important::before,
.md-body div[class*="important"]::before { 
    content: "❗ Important"; 
    color: #a855f7;
}

.md-body .custom-container.warning::before,
.md-body div[class*="warning"]::before { 
    content: "⚠️ Warning"; 
    color: #f59e0b;
}

.md-body .custom-container.caution::before,
.md-body div[class*="caution"]::before { 
    content: "🚨 Caution"; 
    color: #ef4444;
}

.md-body .custom-container::before,
.md-body div[class*="note"]::before,
.md-body div[class*="tip"]::before,
.md-body div[class*="important"]::before,
.md-body div[class*="warning"]::before,
.md-body div[class*="caution"]::before { 
    display: block; 
    font-weight: 600; 
    margin-bottom: 6px; 
} */

/* Remove the default paragraph margin in containers */
.md-body .custom-container p {
    margin-bottom: 0.5rem;
}

.md-body .custom-container p:last-child {
    margin-bottom: 0;
}

.modal.show .modal-dialog {
    z-index: 1060 !important;
}

/* Custom backdrop for better control */
.custom-modal-backdrop {
    z-index: 1040 !important;
}