/* ========================================
   Header - Navigation, Dropdowns
   ======================================== */

/* Header */
.site-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 0 16px;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    max-width: var(--content-max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

/* Logo Dropdown */
.logo-dropdown {
    position: relative;
}

.logo-dropdown .nav-dropdown-toggle {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-dropdown .dropdown-arrow {
    opacity: 0.7;
}

.logo-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-links {
    display: flex;
    gap: 6px;
    align-items: center;
}

.nav-links a, .nav-links button {
    color: rgba(255,255,255,0.9);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.nav-links a:hover, .nav-links button:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.link-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    color: var(--primary);
    padding: 0;
    transition: color 0.15s ease;
}

.link-btn:hover {
    color: var(--primary-dark);
}

/* Messages */
.messages {
    margin-bottom: 20px;
}

.message {
    padding: 14px 18px;
    margin-bottom: 12px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Nav Dropdown (Community menu) */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.9);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.nav-dropdown-toggle:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.nav-dropdown.open .nav-dropdown-toggle {
    background: rgba(255,255,255,0.15);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s ease;
    z-index: 1000;
}

.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease;
}

.nav-dropdown-menu a:hover {
    background: var(--border-light);
    color: var(--primary);
}

.nav-dropdown-menu svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.nav-dropdown-menu a:hover svg {
    color: var(--primary);
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: rgba(255,255,255,0.9);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.user-dropdown-toggle:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.user-dropdown.open .user-dropdown-toggle {
    background: rgba(255,255,255,0.2);
}

.user-icon {
    width: 20px;
    height: 20px;
}

.user-dropdown-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.15s ease;
}

.user-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s ease;
    z-index: 1000;
}

.user-dropdown.open .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-menu a,
.user-dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
    font-family: inherit;
}

.user-dropdown-menu a:hover,
.user-dropdown-menu button:hover {
    background: var(--border-light);
    color: var(--primary);
}

.user-dropdown-menu svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.user-dropdown-menu a:hover svg,
.user-dropdown-menu button:hover svg {
    color: var(--primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.user-dropdown-menu form {
    margin: 0;
}

/* Nav Icon Buttons (Bell, Jury, etc.) */
.nav-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fff;
    transition: all 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-icon-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.nav-icon-btn svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.nav-icon-btn.has-pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fcd34d;
    animation: icon-pulse 3s ease-in-out infinite;
}

.nav-icon-btn.has-pending svg {
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.6));
}

.nav-icon-btn.has-pending:hover {
    background: rgba(251, 191, 36, 0.3);
    color: #fef08a;
}

@keyframes icon-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.icon-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    border: 2px solid var(--primary-dark);
}

/* Search Modal */
.search-modal {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.search-modal.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-modal-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px 20px;
}

.search-form {
    display: flex;
    gap: 8px;
}

.search-form input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s ease;
}

.search-form input:focus {
    border-color: var(--primary);
}

.search-form input::placeholder {
    color: var(--text-muted);
}

.search-submit {
    padding: 12px 16px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.search-submit svg {
    stroke: white;
}

.search-submit:hover {
    background: var(--primary-dark);
}

.search-results {
    margin-top: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.search-results:empty {
    display: none;
}

.search-results-section {
    margin-bottom: 16px;
}

.search-results-section:last-child {
    margin-bottom: 0;
}

.search-section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.search-result-item {
    display: block;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text);
    transition: background 0.15s ease;
}

.search-result-item:hover {
    background: var(--border-light);
}

.search-result-post {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-result-post-title {
    font-weight: 500;
    color: var(--text);
}

.search-result-post-meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-result-board {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-result-board-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.search-result-board-name {
    font-weight: 500;
}

.search-result-board-title {
    color: var(--text-muted);
    font-size: 13px;
}

.search-result-tag {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-result-tag-name {
    font-weight: 500;
    color: var(--primary);
}

.search-result-tag-count {
    color: var(--text-muted);
    font-size: 13px;
}

.search-no-results {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
}

.search-loading {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
}

.search-hint {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 14px;
}
