/* University of Miami Hip & Knee Arthroplasty Registry - Custom Styles
 * Extracted for better caching, maintainability, and smaller HTML payloads.
 * Loaded from /static/css/styles.css with long-term browser caching.
 */

:root {
    --primary-color: #005030;      /* University of Miami Green */
    --secondary-color: #FF6B00;    /* University of Miami Orange (accent) */
    --um-navy: #002D62;
}

body {
    background-color: #f8f9fa;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.btn-primary {
    background-color: #005030;
    border-color: #005030;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #003d24;
    border-color: #003d24;
    color: #ffffff;
}

.bg-primary {
    background-color: #005030 !important;
    color: #ffffff !important;
}

.text-primary {
    color: #005030 !important;
}

.badge-procedure {
    background-color: #e6f7ed;
    color: #00A651;
    font-weight: 500;
}

.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    border: none;
}

.table th {
    background-color: #f1f3f5;
    font-weight: 600;
    font-size: 0.875rem;
}

.stats-card {
    transition: transform 0.2s ease;
}

.stats-card:hover {
    transform: translateY(-3px);
}

.nav-link.active {
    font-weight: 600;
}

.implant-row {
    background-color: #f8f9fa;
}

/* Patient initials badge — always a perfect circle, even beside long names in flex rows */
.patient-avatar {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    max-width: 42px;
    max-height: 42px;
    aspect-ratio: 1 / 1;
    border-radius: 50% !important;
    overflow: hidden;
    line-height: 1;
    white-space: nowrap;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0;
    box-sizing: border-box;
    text-transform: uppercase;
}

.patient-avatar--lg {
    width: 80px;
    height: 80px;
    min-width: 80px;
    min-height: 80px;
    max-width: 80px;
    max-height: 80px;
    font-size: 2rem;
    font-weight: 700;
}

.modal-header {
    background: linear-gradient(135deg, #005030, #003d24);
    color: white;
}

.section-header {
    border-bottom: 3px solid #005030;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.data-table {
    font-size: 0.925rem;
}

/* Additional utility styles used across templates */
.alert-persistent {
    /* Do not auto-dismiss */
}

.complication-date {
    margin-top: 0.25rem;
}

.info-icon:hover {
    opacity: 0.8;
}

/* Registry row action toolbar (patients + surgeries) — always one horizontal row */
.registry-actions {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end;
    gap: 0.35rem;
    padding: 0.2rem;
    border-radius: 0.65rem;
    background: #f1f3f5;
    border: 1px solid #e9ecef;
    white-space: nowrap !important;
    width: auto !important;
    max-width: none !important;
    vertical-align: middle;
}

.registry-actions--compact {
    gap: 0.25rem;
    padding: 0.15rem;
}

/* Form must stay inline in the flex row (not block / full width) */
.registry-action-form {
    display: inline-flex !important;
    flex: 0 0 auto;
    margin: 0 !important;
    padding: 0;
    width: auto !important;
    max-width: none;
}

.registry-action-btn {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    width: auto !important;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-height: 2rem;
    min-width: 2rem;
    padding: 0.35rem 0.55rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    background: #fff;
    color: #495057;
    text-decoration: none;
    white-space: nowrap !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
    cursor: pointer;
}

/* Icon-only compact buttons stay side-by-side */
.registry-actions--compact .registry-action-btn {
    min-height: 1.85rem;
    min-width: 1.85rem;
    padding: 0.3rem 0.45rem;
}

/* Table cells that hold the toolbar must not force wrapping */
table.data-table td .registry-actions,
table.table td .registry-actions {
    display: inline-flex !important;
    flex-direction: row !important;
}

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

.registry-action-btn--view {
    color: #005030;
    border-color: #c8e6d5;
}

.registry-action-btn--view:hover {
    background: #e6f7ed;
    color: #003d24;
}

.registry-action-btn--edit {
    color: #0d6efd;
    border-color: #cfe2ff;
}

.registry-action-btn--edit:hover {
    background: #e7f1ff;
    color: #084298;
}

.registry-action-btn--delete {
    color: #b02a37;
    border-color: #f1c2c7;
}

.registry-action-btn--delete:hover {
    background: #f8d7da;
    color: #842029;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .stats-card .display-6 {
        font-size: 1.5rem;
    }

    .registry-action-btn span {
        display: none;
    }

    .registry-action-btn {
        padding: 0.35rem 0.5rem;
    }
}
