/* Global Styles for Surgeon Preferences Application */

/* Body and Layout */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
}

.footer {
    margin-top: auto;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #0d6efd 0%, #0099ff 100%) !important;
}

/* Buttons */
.btn-primary {
    background: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background: #0b5ed7;
    border-color: #0a58ca;
}

/* Forms */
.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Cards */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Tables */
.table-header-bg {
    background-color: #f8f9fa;
}

.table a {
    color: #0d6efd;
    text-decoration: none;
}

.table a:hover {
    text-decoration: underline;
}

/* Alerts */
.alert {
    margin-bottom: 0;
    position: relative;
    z-index: 1000;
}

/* Search */
.search-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Custom text colors */
.text-primary {
    color: #0d6efd !important;
}

/* Custom backgrounds */
.bg-primary {
    background-color: #0d6efd !important;
}

/* --- PRINT STYLES START --- */
/* Rule to hide print-only elements from the screen */
.print-only {
    display: none;
}

@media print {
    /* --- ADDED/CORRECTED RULES START --- */
    /* When printing, show elements marked as print-only */
    .print-only {
        display: block !important;
    }

    /* When printing the main card, hide the dedicated image section */
    #imageSection {
        display: none !important;
    }
    /* --- ADDED/CORRECTED RULES END --- */

    /* Reset background colors and remove shadows */
    body {
        background: none;
        margin: 0;
        padding: 0;
        color: #000 !important; /* Ensure all default text is black */
    }

    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
        background-color: #fff !important;
    }

    /* Style for the main card title header when printing */
    .card-header {
        background-color: #ffffff !important;
        color: #000000 !important;
        border-bottom: 2px solid #dee2e6 !important;
        padding-bottom: 0.5rem !important;
    }

    /* Ensure any element inside the header (like the h4) is also black */
    .card-header * {
        color: #000000 !important;
    }

    /* Hide non-essential elements */
    .navbar,
    .footer,
    .btn,
    .no-print,
    .alert,
    form[action="/logout"],
    .search-input,
    button[type="submit"],
    .breadcrumb,
    .breadcrumb-item,
    nav[aria-label="breadcrumb"] {
        display: none !important;
    }

    /* Ensure table headers print on each page */
    thead {
        display: table-header-group;
    }

    /* Break tables appropriately */
    tr, .details-grid > div {
        page-break-inside: avoid;
    }

    /* Adjust links to show their URLs (optional, can be removed) */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }

    /* Don't show URLs for internal links */
    a[href^="/"]:after,
    a[href^="#"]:after {
        content: "";
    }

    .table td,
    .table th {
        border: 1px solid #dee2e6 !important;
    }

    /* Adjust margins and padding */
    .container {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}
/* --- PRINT STYLES END --- */