/*
 * REVISED FOR BOOTSTRAP 5
 * Unnecessary or outdated Bootstrap 3 overrides have been removed or commented out.
 * Your custom component styles (events, tooltips, etc.) have been kept as they don't conflict.
*/


/* --- General Layout & Body --- */

/* This is still needed to push content down below your .fixed-top navbar.
   You may need to adjust the value if your navbar height changes. */
body {
  padding-top: 40px; /* Increased slightly for a common BS5 navbar height */
  /* If you implement a sticky footer using flexbox, you may add more styles here */
}

h2 {
    font-weight: bold;
}

/* --- Navbar & Header --- */

.top-container {
    padding-left: 50px;
    padding-right: 50px;
}

.navbar-top {
    border-bottom:none;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); /* A more modern shadow effect */
    /* NOTE: You can also use Bootstrap's built-in shadow classes like `.shadow-sm`
       directly on the navbar element in your HTML for a similar effect. */
}

/*
 * Navbar Logo Size
*/
.navbar-brand {
    width: 107px;
    height: 70px;
    display: inline-block;
    margin-bottom: -70px; /* Be careful with large negative margins. */
}

.navbar-brand img {
    width: auto;
    height: 90px;
    margin-top: -38px;
    margin-left: -20px;
}

/*
 * Dark Mode Logo Swap
*/

/* By default, hide the dark logo */
.logo-dark {
  display: none;
}
.logo-light {
  display: block;
}

/* When dark mode is active, hide the light logo and show the dark one */
[data-bs-theme="dark"] .logo-dark {
  display: block;
}
[data-bs-theme="dark"] .logo-light {
  display: none;
}

.navbar.bg-light {
    background-color: white !important; /* Overriding BS5's default .bg-light */
}

.navbar .navbar-nav .nav-link {
    color: black;
    font-size: 18px;
}

[data-bs-theme="dark"] .navbar .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.65); /* A slightly muted white, Bootstrap's default */
}

[data-bs-theme="dark"] .navbar .navbar-nav .nav-link:hover {
  color: #fff; /* Full white on hover */
}

/* Optional: To make the entire navbar even shorter, you can reduce its padding. */
.navbar {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    background-color: #f8f9fa; /* Bootstrap's light color */
    border-bottom: 1px solid #dee2e6;
}
[data-bs-theme="dark"] .navbar {
    background-color: #212529; /* Bootstrap's dark color */
    border-bottom: 1px solid #343a40;
}

/*
 * Mobile Navbar Fix
 * Adds a top margin to the expanded menu on small screens
 * to prevent it from being overlapped by the site logo.
*/
@media (max-width: 991.98px) {
  .navbar-collapse {
    margin-top: 20px; /* This creates the space. Adjust this value as needed. */
    border-bottom: 1px solid #dee2e6; /* Adds a clean bottom border */
  }
}

/* --- General Utilities & Custom Components (SAFE) --- */
/* The following styles are custom to your site and do not clash with Bootstrap 5. They are safe to keep. */

a[href^="http://"]:not(.btn),
a[href^="https://"]:not(.btn),
a[href^="mailto:"]:not(.btn) {
    background: url("../img/external-link-10.f31a95bdda13.png") center right no-repeat;
    padding-right: 13px;
}

.black_text {
    color: black;
    font-weight: bold;
}

.copyright-text {
    color: black;
    vertical-align: middle;
    padding-top: 14px;
}

img.diploma {
    border:5px solid black;
}

.events-title {
    border-bottom: 1px solid lightgray;
}

/* Event tiles styling */
.event-tile {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: flex; /* Use flexbox to control the inner layout */
  flex-direction: column; /* Stack image and content vertically */
  height: 100%; /* Ensure tile fills its container (for grid layouts) */
}

.event-tile:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.event-tile .card-img-top {
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background-color: transparent;
}

.event-tile .card-body {
  display: flex;
  flex-direction: column; /* Stack content inside the body */
  flex-grow: 1; /* Allow the body to grow and fill space */
}

.event-tile .card-title {
    font-size: 1.25rem;
    font-weight: bold;
}

.event-tile .card-text.event-tile-status {
    margin-top: auto; /* This pushes the status to the bottom */
    font-weight: bold;
}

/* Event list item styling (SAFE) */
/*
 * Flexbox Wrapping Grid for Event Tiles
*/
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
    justify-content: center;
}

/*
 * Card Image Customization
 * Creates a square image container for event tiles.
*/
.card .card-img-top {
  width: 100%; /* Make the image container take the full width of the card */
  object-fit: contain; /* Scale image down to fit inside the square, without cropping */
  background-color: transparent; /* Optional: A light background for any empty space */
}

[data-bs-theme="dark"] .card {
  background-color: #2b3035; /* A slightly lighter dark gray than the body */
  color: #dee2e6; /* A light gray for text */
  border-color: #495057; /* A subtle border in dark mode */
}

/* For event titles within the card */
[data-bs-theme="dark"] .card .card-title {
  color: #f8f9fa; /* Ensure titles are bright white */
}

[data-bs-theme="dark"] .card .card-body {
  background-color: inherit; /* This makes it match the card's background */
}

/* For muted text (like dates, registration counts) within the card */
[data-bs-theme="dark"] .card .text-body-secondary {
  color: #adb5bd !important; /* Muted light gray for secondary text */
}

/* For the status text (Open/Closed) */
[data-bs-theme="dark"] .event-tile-status.text-success {
  color: #74b88f !important; /* A light green for success */
}

[data-bs-theme="dark"] .event-tile-status.text-danger {
  color: #ea868f !important; /* A light red for danger */
}

/* Dropzone styling (SAFE) */
div#gray-cover {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999; /* Adjusted z-index */
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: table;
    text-shadow: 1px 1px 2px #000;
    color: #fff;
    font: bold 42px Oswald, DejaVu Sans, Tahoma, sans-serif;
}
div.gray-cover-text {
    display: table-cell;
    text-align: center;
    vertical-align: middle;
}
.event-cover-image-upload {
    max-width: 100%; /* Let the grid system control the size */
    border-radius: 10px;
}
.dropzone {
    border-radius: 10px;
}
.dz-message {
    font-size: 30px;
    font-weight: bold;
}

[data-bs-theme="dark"] .dropzone {
  background-color: var(--bs-dark-bg-subtle) !important;
  border-color: var(--bs-border-color) !important;
  color: var(--bs-body-color) !important;
}
/*
 * Dark Mode Fix for Dropzone.js Thumbnail Background
*/
[data-bs-theme="dark"] .dropzone .dz-preview .dz-image {
    border-radius: 0;
}

/* Custom tooltips (SAFE) */
.my_tooltip {
    /* These custom components are fine as they use unique class names. */
}

/* Your custom modal styles (SAFE) */
.rc-modal-background {
    position: fixed;
    z-index: 1060; /* Position it just above BS5's backdrop z-index */
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(0,0,0,0.4);
}
.rc-modal-message {
    margin: 5px;
}
.rc-modal-messages-container {
    width: 100%;
    margin: 0 auto;
    top: 0;
    position: relative;
    overflow: auto;
    max-height: 100%;
    padding: 50px 25%;
}

/* --- Footer Link Styling --- */
.footer .nav-link {
  color: #212529; /* A standard dark gray, Bootstrap's default body text color */
  text-decoration: none; /* Removes the underline by default */
}
[data-bs-theme="dark"] .footer .nav-link {
  color: #adb5bd; /* A muted light gray */
}

.footer .nav-link:hover {
  color: #000; /* Makes the link black on hover */
  text-decoration: underline; /* Adds an underline on hover for clear feedback */
}
[data-bs-theme="dark"] .footer .nav-link:hover {
  color: #fff; /* White on hover */
}

/*
 * Fixed Navbar Anchor Link Fix
*/
.scroll-anchor {
  display: block;
  position: relative;
  top: -70px; /* This value should be a little MORE than your navbar's height */
  visibility: hidden;
}

.table-nowrap th,
.table-nowrap td {
  white-space: nowrap;
}

.table-wrap-text th,
.table-wrap-text td {
  white-space: normal !important;
}

/*
 * "To Top" Floating Button
*/
#toTopBtn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1030; /* Ensure it's above most content */
}

/*
 * PRINTING STYLES - leave at the end of the file
 * These styles make the print preview look good on a computer screen.
*/
.print-header { font-size: 20pt; font-weight: bold; }
.print-row-header { font-size: 12pt; font-weight: bold; }
.printable-table { margin-top: 5mm; border: 0.75mm solid black; } /* Main table border for screen */
.printable-table td,
.printable-table th { /* Cell borders for screen */
    border: 0.25mm solid black;
    padding: 5px;
    vertical-align: top;
}
.signature-box { border: 3px solid black; }
.print-large { font-size: 26pt; font-weight: bold; }
.print-row-header-strong { font-size: 18pt; font-weight: bold; }
.print-small { font-size: 11pt; }
.print-td-value { margin-left: 5px; }


/*
 * Print Styles (REVISED AGAIN FOR BOOTSTRAP 5)
 * These styles are only applied when the user prints the page.
*/
@media print {
    @page {
        size: A4 portrait;
        margin: 10mm 8mm; /* Consistent margins */
    }

    .dashboard_content h1,
    .dashboard_content h2 {
        display: none !important;
    }

    /* --- General Reset for Print --- */
    body {
        padding-top: 0 !important; /* Force remove top padding */
        background: transparent !important; /* Ensure no background colors */
        font-size: 7pt !important; /* Smaller base font size for print */
        color: black !important;
        -webkit-print-color-adjust: exact; /* Ensure background colors are printed if used for design */
        print-color-adjust: exact;
    }

    /* Universal reset for elements that might introduce unwanted space or styling */
    * {
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        text-shadow: none !important;
        transition: none !important;
        border-color: black !important; /* Ensure borders are black */
    }

    /* --- Hide Unwanted Elements --- */
    #sidebarMenu,
    footer.footer,
    nav[aria-label="breadcrumb"],
    #djDebug,
    .screen-only,
    .h2 {
        display: none !important;
    }

    /* --- Handle the Main Navbar and Logo --- */
    /* Only allow specific elements within the navbar to show */
    .navbar {
        min-height: auto !important; /* Remove min-height */
        padding: 0 !important; /* Remove padding */
        margin-bottom: 5mm !important; /* Add space below the logo */
    }

    .navbar-brand {
        display: block !important; /* Ensure brand is visible */
        text-align: left !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important; /* Allow image to define height */
    }
    .navbar-brand img {
        max-height: 1.2cm !important; /* Smaller logo for print */
        width: auto !important;
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Hide other navbar components */
    .navbar button,
    .navbar .navbar-toggler,
    .navbar .navbar-nav,
    .navbar .container-fluid > div:not(.navbar-brand), /* Hide other elements in navbar-fluid */
    .navbar .offcanvas {
        display: none !important;
    }

    /* --- Table Specific Print Styles --- */
    .printable-table {
        margin-top: 2mm !important;
        border: none !important; /* Remove outer table border if cell borders are active */
    }

    .printable-table table {
        width: 100% !important; /* Ensure table spans full width */
        border-collapse: collapse !important; /* Crucial for clean cell borders */
        /* Removed the table-level border as we're doing cell borders */
    }

    .printable-table td,
    .printable-table th {
        border: 0.25mm solid black !important; /* RE-ADDED: Cell borders for print */
        padding: 0.5mm !important; /* Reduced padding for more content */
        vertical-align: top !important;
        font-size: inherit !important; /* Inherit font size from body */
        line-height: 1.2 !important;
    }

    /* --- Adjust Print Content Font Sizing --- */
    /* Further reduction of font sizes to fit more on the page */
    .print-header { font-size: 10pt !important; }
    .print-row-header-strong { font-size: 9pt !important; }
    .print-row-header { font-size: 7pt !important; }
    .print-small { font-size: 6pt !important; }
    .print-large { font-size: 16pt !important; }

    /* --- Page Break Rules --- */
    .page_break {
        page-break-after: always !important;
        margin-top: 1cm !important; /* Add space between pages */
    }
    .no_page_break {
        page-break-inside: avoid !important;
    }
}