/* ============================================
   HEADER, PROFILE, AND NOTIFICATIONS STYLES
   ============================================ */

/* Header styling */
.top-row .dropdown-toggle::after {
    display: none;
}

.top-row .btn-link {
    color: inherit;
    text-decoration: none;
}

.top-row .btn-link:hover {
    color: #10b981;
}

/* Header container to prevent dropdown clipping */
.header-container {
    padding: 0 1rem;
    overflow: visible !important;
    position: relative;
    z-index: 1050;
}

/* Remove all focus borders from header elements */
.header-container *:focus,
.header-container *:focus-visible,
.header-container *:active {
    outline: none !important;
    box-shadow: none !important;
}

/* But allow background color changes on hover/focus for interactive elements */
.header-container button:hover,
.header-container .dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.header-container .dropdown {
    position: relative;
}

.header-container .dropdown-menu.dropdown-menu-end {
    position: absolute;
    right: 0;
    left: auto !important;
    transform: none;
    margin-top: 1rem;
    min-width: 200px;
    max-width: 280px !important;
    width: auto !important;
}

/* Ensure dropdowns don't overflow viewport - but exclude profile dropdown */
.header-container .dropdown-menu:not(.notification-dropdown) {
    max-width: min(280px, calc(100vw - 2rem)) !important;
}

@media (max-width: 768px) {
    .header-container .dropdown-menu {
        right: 0.5rem;
        max-width: calc(100vw - 1rem);
    }
}

/* Ensure main container doesn't clip dropdowns */
main {
    overflow: visible !important;
}

.top-row {
    overflow: visible !important;
}

/* Notification bell badge styling */
.notification-bell-container {
    padding-right: 8px;
    padding-top: 4px;
}

.notification-bell-container button,
.notification-bell-container button:focus,
.notification-bell-container button:focus-visible,
.notification-bell-container button:active {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Profile dropdown button styling */
.header-container .dropdown button,
.header-container .dropdown button:focus,
.header-container .dropdown button:focus-visible,
.header-container .dropdown button:active,
.header-container .btn,
.header-container .btn:focus,
.header-container .btn:focus-visible,
.header-container .btn:active,
.header-container .btn-link,
.header-container .btn-link:focus,
.header-container .btn-link:focus-visible,
.header-container .btn-link:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Profile avatar and button - greenish theme */

/* Small avatar for header dropdown */
.profile-avatar-header {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: 600;
    transition: all 0.2s;
}

/* Large avatar for profile page */
.profile-avatar-large {
    width: 80px;
    height: 80px;
    font-size: 2rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    color: white;
    font-weight: bold;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3), 0 4px 6px -2px rgba(16, 185, 129, 0.2);
}

.profile-avatar-large span {
    font-size: 2rem;
}

.profile-avatar-large:hover {
    transform: scale(1.05);
}

/* Responsive sizing for large avatar */
@media (min-width: 768px) {
    .profile-avatar-large {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
    
    .profile-avatar-large span {
        font-size: 2.5rem;
    }
}

/* Legacy support - keep .profile-avatar as alias for header */
.profile-avatar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: 600;
}

.profile-button {
    color: #475569;
    transition: all 0.2s;
    margin-top: 4px;
}

.profile-button:hover {
    color: #047857;
}

.profile-button:hover .profile-avatar,
.profile-button:hover .profile-avatar-header {
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    transform: scale(1.05);
}

/* Profile dropdown menu items */
.header-container .dropdown-menu .dropdown-item,
.header-container .dropdown-menu .dropdown-item:focus,
.header-container .dropdown-menu .dropdown-item:focus-visible,
.header-container .dropdown-menu .dropdown-item:active {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Profile dropdown user info section - ensure text truncation */
.header-container .dropdown-menu .px-3 {
    max-width: 100%;
    overflow: hidden;
}

.header-container .dropdown-menu .px-3 .fw-bold,
.header-container .dropdown-menu .px-3 small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Profile dropdown specific styling */
.header-container .profile-dropdown {
    max-width: 280px !important;
    width: auto !important;
    min-width: 200px;
}

.header-container .profile-dropdown .dropdown-item {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-badge {
    top: -4px !important;
    right: -8px !important;
    font-size: 0.6rem;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
    font-weight: 600;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Notification dropdown styling */
.notification-dropdown {
    min-width: 400px !important;
    max-width: min(450px, calc(100vw - 2rem));
    max-height: 500px;
    overflow-y: auto;
    position: absolute;
    right: 0;
    left: auto !important;
    transform: none;
    margin-top: 0.5rem;
}

/* Standardized notification dropdown header */
.notification-dropdown .dropdown-header {
    font-size: 0.9375rem; /* 15px - standardized section title size */
    font-weight: 700;
    color: #1e293b; /* standardized dark text color */
}

.notification-dropdown .dropdown-header .badge {
    font-size: 0.7rem; /* 11.2px - standardized small text size */
    font-weight: 500;
}

.notification-dropdown .dropdown-item {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 0.8125rem; /* 13px - standardized body text size */
    color: #1e293b; /* standardized dark text color */
}

/* Standardized notification title */
.notification-dropdown .dropdown-item .fw-bold {
    font-size: 0.8125rem; /* 13px - standardized body text size */
    font-weight: 700;
    color: #1e293b !important; /* standardized dark text color */
}

.notification-dropdown .dropdown-item .text-muted {
    font-size: 0.7rem; /* 11.2px - standardized small text size */
    color: #64748b !important; /* standardized muted text color */
}

/* Standardized notification timestamp */
.notification-dropdown .dropdown-item small.text-muted {
    font-size: 0.7rem; /* 11.2px - standardized small text size */
    color: #64748b !important; /* standardized muted text color */
}

/* Standardized "New" badge */
.notification-dropdown .badge.bg-success {
    font-size: 0.7rem; /* 11.2px - standardized small text size */
    font-weight: 500;
}

/* Standardized "View All Notifications" link */
.notification-dropdown .dropdown-item.text-success {
    font-size: 0.8125rem; /* 13px - standardized body text size */
    font-weight: 700;
    color: #16a34a !important; /* standardized success/green color */
}

.notification-dropdown .dropdown-item:focus,
.notification-dropdown .dropdown-item:focus-visible,
.notification-dropdown .dropdown-item:active {
    background-color: #f8f9fa;
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.notification-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #10b981;
}

.btn-primary {
    color: #fff;
    background-color: #10b981;
    border-color: #059669;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #059669;
    border-color: #047857;
    color: #fff;
}

.btn-outline-primary {
    color: #10b981;
    border-color: #10b981;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background-color: #10b981;
    border-color: #10b981;
    color: #fff;
}

.text-primary {
    color: #10b981 !important;
}

.bg-primary {
    background-color: #10b981 !important;
}

.border-primary {
    border-color: #10b981 !important;
}

/* Global focus styles - but exclude header elements */
.btn:focus:not(.header-container .btn):not(.header-container .btn-link),
.btn:active:focus:not(.header-container .btn):not(.header-container .btn-link),
.btn-link.nav-link:focus:not(.header-container .btn-link),
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #10b981;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}
