/* Navbar styling */
.navbar {
    background-color: #FFFFFF;
    /* Change background to white */
    border-bottom: 1px solid #E0E0E0;
    /* Add a light border */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 0rem 1rem;
    /* Adjust padding - Reduced vertical padding */
    position: fixed;
    /* Make navbar fixed */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    /* Ensure navbar is on top */
    transition: background-color 0.3s ease-in-out;
    /* Smooth background transition */
}

.navbar-scrolled {
    background-color: rgba(255, 255, 255, 0.9) !important;
    /* Translucent white background on scroll */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* Optional: slightly more prominent shadow when scrolled */
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
    letter-spacing: 0.5px;
    color: #000000;
    /* Change brand text color to black */
}

.navbar-brand img {
    filter: none;
    /* Remove existing filter if any */
    transition: transform 0.3s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

/* Nav item sizing and spacing */
.nav-item {
    margin: 0 10px;
    /* Increased margin between items */
    display: flex;
    align-items: center;
}

.nav-link {
    padding: 0.5rem 0;
    /* Adjust padding - removed horizontal padding from link itself */
    margin: 0;
    /* Remove margin from link */
    border-radius: 0;
    /* Remove border radius */
    font-weight: 500;
    font-size: 0.95rem;
    color: #000000;
    /* Change nav link text color to black */
    transition: all 0.2s ease;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    /* For active state underline */
}

.nav-link:hover {
    color: var(--iwi-blue);
    /* IWI brand blue on hover */
    background-color: transparent;
    transform: none;
}

.nav-link.active {
    color: var(--iwi-blue);
    font-weight: 600;
    background-color: transparent;
    box-shadow: none;
    border-bottom: 2px solid var(--iwi-blue);
}

.nav-link i {
    /* Removed icon, hide any residual space */
    display: none;
}

.nav-link.active i {
    /* Removed icon */
    display: none;
}

/* Adjust navbar-toggler icon color for better visibility on white background */
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 0, 0, 0.7)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-toggler {
    border-color: rgba(0, 0, 0, 0.1);
}

/* Dropdown menu styling */
.dropdown-menu {
    border: none;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    margin-top: 0.5rem;
    min-width: 220px;
}

.dropdown-item {
    padding: 0.6rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.dropdown-item:hover {
    background-color: rgba(var(--iwi-blue-rgb), 0.08);
    transform: translateX(3px);
}

.dropdown-item i {
    width: 20px;
    margin-right: 8px;
    color: var(--iwi-blue);
}

/* Global Search Container */
.global-search-container {
    position: relative;
    width: 250px;
}

.global-search-container form {
    display: flex;
    width: 100%;
    align-items: center;
    background-color: #f1f5f9;
    border-radius: 50px;
    padding: 0.3rem 0.5rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid transparent;
}

.global-search-container form:focus-within {
    background-color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 86, 179, 0.1);
    border-color: rgba(var(--iwi-blue-rgb), 0.3);
    width: 280px;
    /* Slight expansion on focus for dynamic interaction */
}

.global-search-container input {
    flex-grow: 1;
    border: none;
    background-color: transparent;
    color: #1e293b;
    padding: 0.2rem 0.8rem;
    font-size: 0.95rem;
    outline: none;
    box-shadow: none !important;
}

.global-search-container input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.global-search-container input:focus {
    box-shadow: none;
    border-color: transparent;
    background-color: transparent;
}

.global-search-container button {
    border: none;
    background-color: var(--iwi-blue);
    color: #ffffff;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-left: 0.2rem;
}

.global-search-container button:hover {
    background-color: #004494;
    /* Darker shade of IWI blue */
    transform: scale(1.05);
}

.global-search-container button i {
    font-size: 0.9rem;
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    min-width: 300px;
}

.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
}

.status-active {
    background-color: var(--iwi-success-light);
    color: var(--iwi-success);
}

.status-closed {
    background-color: var(--iwi-danger-light);
    color: var(--iwi-danger);
}

.status-upcoming {
    background-color: var(--iwi-warning-light);
    color: var(--iwi-warning);
}

.search-box {
    margin-bottom: 20px;
}

.filter-section {
    margin-bottom: 20px;
}

.action-buttons .btn {
    margin-right: 5px;
}

.pagination {
    margin-top: 20px;
}

.sort-icon {
    cursor: pointer;
}

.table-responsive {
    overflow-x: visible;
}

.deadline-warning {
    color: var(--iwi-danger);
    font-weight: bold;
}

.tooltip-inner {
    max-width: 300px;
}

.journal-badges {
    margin-top: 5px;
}

.journal-badges .badge {
    margin-right: 3px;
    font-size: 0.75rem;
}

.badge.bg-primary {
    background-color: var(--iwi-blue) !important;
}

.badge.bg-success {
    background-color: var(--iwi-success) !important;
}

.badge.bg-info {
    background-color: var(--iwi-blue) !important;
}

.badge.bg-secondary {
    background-color: #6c757d !important;
}

/* Topic and Category Styles */
.subject-categories {
    background-color: #f8f9fa;
    border-radius: 5px;
    padding: 10px;
}

.subject-item {
    margin-bottom: 10px;
}

.subject-item:last-child {
    margin-bottom: 0;
}

.subject-item .badge {
    font-size: 0.75rem;
    margin-right: 3px;
    margin-bottom: 3px;
    display: inline-block;
}

/* Responsive behavior for global search */
@media (max-width: 991.98px) {
    .navbar .container {
        max-width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .navbar-brand img {
        height: 35px;
    }

    .global-search-container {
        width: 100%;
        margin: 10px 0;
    }

    .global-search-container form:focus-within {
        width: 100%;
        /* Keep 100% on mobile when focused to prevent overflowing screen */
    }

    .navbar-collapse {
        max-height: 80vh;
        overflow-y: auto;
    }

    .navbar-nav .dropdown-menu {
        position: static;
        float: none;
        width: auto;
        margin-top: 0;
        box-shadow: none;
        border-radius: 0;
    }
}

@media (max-width: 767.98px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .page-header .btn {
        margin-top: 1rem;
        align-self: flex-start;
    }

    .table-responsive {
        margin-bottom: 0;
    }

    .card-header h5 .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 575.98px) {
    .navbar-brand span {
        display: none;
    }

    .navbar-toggler {
        padding: 0.25rem 0.5rem;
        font-size: 1rem;
    }

    .card-header {
        padding: 0.75rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    .table-container {
        padding: 10px;
        margin-bottom: 10px;
    }

    [data-bs-toggle="tooltip"] {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Fixed Search Container */
.fixed-search-container {
    position: fixed;
    bottom: 30px;
    /* Increased distance from bottom */
    right: 30px;
    /* Increased distance from right */
    z-index: 1050;
    /* Ensure it's above other content and navbar */
    display: flex;
    /* Use flexbox for alignment */
    align-items: center;
}

.fixed-search-container .search-input {
    width: 0;
    /* Initially hide input */
    opacity: 0;
    transition: width 0.3s ease-in-out, opacity 0.3s ease-in-out;
    padding: 6px 12px;
    /* Add padding */
    border: 1px solid #CCCCCC;
    /* Match header input border */
    border-radius: 6px 0 0 6px;
}

.fixed-search-container.active .search-input {
    width: 200px;
    /* Expand input when active */
    opacity: 1;
    margin-right: 5px;
    /* Space between input and button */
}

.fixed-search-container .search-toggle-btn {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--iwi-blue);
    color: var(--iwi-blue);
    background-color: transparent;
    border-radius: 50%;
    padding: 0;
    transition: background-color var(--iwi-transition), color var(--iwi-transition);
    z-index: 1051;
}

.fixed-search-container .search-toggle-btn:hover {
    background-color: var(--iwi-blue);
    color: #FFFFFF;
    border-color: var(--iwi-blue);
}

/* Highlight style for search results */
mark {
    background-color: #FFFF00;
    /* Yellow background */
    color: #000000;
    /* Black text */
    padding: 0.1em 0.2em;
    border-radius: 3px;
}

/* (Bootstrap primary override is now in style.css :root) */

/* Home page specific styles */
.home-page-header-icon {
    font-size: 0.8em;
    /* Adjust icon size relative to h1 */
    margin-right: 0.3em;
}

.card {
    border: 1px solid #e0e0e0;
    /* Softer border for cards */
    border-radius: 0.5rem;
    /* Slightly more rounded corners */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    /* Softer shadow */
}

.card-header {
    padding: 0.75rem 1.25rem;
    /* Consistent padding */
}

.list-group-item {
    border-color: #f0f0f0;
    /* Lighter border for list items */
    padding: 0.75rem 1rem;
}

.list-group-item h6 {
    margin-bottom: 0.25rem;
    /* Adjust spacing */
}

/* Page Header Styling */
.page-header {
    padding-top: 0.5rem;
    /* Reduced top padding */
    padding-bottom: 1rem;
    /* Adjusted bottom padding */
    margin-bottom: 1.5rem;
    /* Space below header */
    border-bottom: 1px solid #dee2e6;
    /* Subtle bottom border */
}

.page-header h1,
.page-header h2,
.page-header .h1,
.page-header .h2 {
    font-size: 1.75rem;
    /* Slightly reduced font size for page titles */
    font-weight: 600;
    /* Adjust font weight */
    color: #343a40;
    /* Darker text color for title */
    margin-bottom: 0;
    /* Remove default margin from title */
}

.page-header .lead {
    font-size: 0.95rem;
    /* Adjust lead text size */
    color: #6c757d;
    /* Muted color for lead text */
    margin-top: 0.25rem;
}


/* Footer styling to match header */
.main-footer {
    background-color: #FFFFFF;
    padding-top: 5px;
    padding-bottom: 5px;
    border-top: 1px solid #E0E0E0;
    font-size: 0.9rem;
    /* Base font size for footer, adjust as needed */
}

.main-footer .container {
    max-width: 800px;
    /* Adjust this value to make the footer content narrower or wider */
}

.main-footer strong,
.main-footer strong a {
    font-weight: 600;
    color: #000000;
    /* Black like navbar-brand */
    text-decoration: none;
}

.main-footer a {
    font-weight: 500;
    color: #000000;
    /* Black like nav-link */
    text-decoration: none;
    transition: color 0.2s ease;
}

.main-footer a:hover {
    color: var(--iwi-blue);
    text-decoration: none;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    background-color: var(--iwi-blue);
    color: #FFFFFF;
    z-index: 1050;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.back-to-top:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Responsive footer adjustments for mobile */
@media (max-width: 767.98px) {
    .main-footer .d-flex {
        flex-direction: column;
        align-items: center;
        /* Ensure items are centered in column layout */
    }

    .main-footer .d-flex>* {
        margin-right: 0 !important;
        /* Remove right margin from all direct children */
        margin-bottom: 10px;
        /* Add bottom margin for spacing */
    }

    .main-footer .d-flex>*:last-child {
        margin-bottom: 0;
        /* Remove bottom margin from the last child */
    }
}