/* ═══════════════════════════════════════════════════════
   DeckView AI — Header / Navigation
   ═══════════════════════════════════════════════════════ */

.site-header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid var(--color-border);
    padding: 0 var(--space-6);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
    display: flex;
    align-items: center;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--max-w-7xl);
    width: 100%;
    margin: 0 auto;
}

.logo {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: var(--tracking-tight);
    transition: opacity var(--duration-fast) var(--ease-default);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.logo:hover {
    opacity: 0.8;
    color: var(--color-text);
}

/* ── Nav Items ── */
.navbar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* ── Buttons ── */
.btn {
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    transition: all var(--duration-fast) var(--ease-default);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    border: 1px solid transparent;
    line-height: 1.4;
}

.btn-login {
    color: var(--color-text-secondary);
    background: transparent;
    border: 1px solid transparent;
}

.btn-login:hover {
    color: var(--color-text);
    background-color: var(--color-surface-active);
}

.btn-register {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
    border: 1px solid var(--color-primary);
    font-weight: 600;
}

.btn-register:hover {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: var(--color-text-inverse);
    box-shadow: var(--shadow-sm);
}

/* ── Org Badge ── */
.active-org-badge {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background-color: var(--color-surface);
    padding: 6px var(--space-4);
    color: var(--color-text);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-default);
    cursor: pointer;
}

.active-org-badge:hover {
    border-color: var(--color-primary);
    background-color: var(--color-primary-50);
    color: var(--color-primary-dark);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.org-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--color-success);
    border-radius: 50%;
    flex-shrink: 0;
}

.org-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.org-tokens {
    background-color: var(--color-primary-50);
    color: var(--color-primary-dark);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    margin-left: 2px;
}

/* ── Dropdowns ── */
.user-dropdown, .billing-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 12px;
    background: transparent;
    display: none;
}

.user-dropdown:hover::after {
    display: block;
}

.dropdown-toggle {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    padding: 6px var(--space-3);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    transition: all var(--duration-fast) var(--ease-default);
    font-family: var(--font-sans);
}

.dropdown-toggle:hover {
    border-color: var(--color-border-hover);
    background-color: var(--color-surface-hover);
}

.arrow {
    font-size: 10px;
    color: var(--color-text-muted);
    transition: transform var(--duration-fast) var(--ease-default);
}

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

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background-color: var(--color-surface);
    min-width: 220px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    overflow: hidden;
    animation: menuFadeIn var(--duration-normal) var(--ease-out);
}

.user-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-header {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border-light);
}

.dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: all var(--duration-fast) var(--ease-default);
    font-family: var(--font-sans);
}

.dropdown-item:hover {
    background-color: var(--color-surface-hover);
    color: var(--color-text);
}

.dropdown-item[style*="color:#ef4444"],
.dropdown-item[style*="color: #ef4444"] {
    color: var(--color-error) !important;
}

.dropdown-item[style*="color:#ef4444"]:hover,
.dropdown-item[style*="color: #ef4444"]:hover {
    background-color: var(--color-error-light) !important;
}

/* ── Notification Bell ── */
.notification-btn,
.notification-toggle {
    background: transparent;
    color: var(--color-text-secondary);
    padding: var(--space-2);
    border-radius: var(--radius-md);
    position: relative;
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-btn:hover,
.notification-toggle:hover {
    color: var(--color-text);
    background-color: var(--color-surface-hover);
    border-color: var(--color-border-hover);
}

.badge-counter {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: var(--color-error);
    color: white;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    border: 2px solid var(--color-surface);
    font-weight: 600;
}

.notification-dropdown {
    position: relative;
    display: inline-block;
}

.notification-dropdown .dropdown-menu {
    right: 0;
    min-width: 300px;
}

.notification-dropdown .dropdown-menu.active {
    display: block;
    animation: menuFadeIn var(--duration-normal) var(--ease-out);
}

.notification-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-list .empty-state {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.notification-list .dropdown-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border-bottom: 1px solid var(--color-border-light);
    white-space: normal;
    padding: var(--space-3) var(--space-4);
}

.notification-list .dropdown-item:last-child {
    border-bottom: none;
}

.notification-list .dropdown-item span {
    line-height: 1.4;
    font-size: var(--text-sm);
}

.notification-list .dropdown-item::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--color-primary);
    border-radius: 50%;
    margin-bottom: 4px;
}

/* ── Feedback Button ── */
.btn-feedback {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    padding: 6px var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
    font-family: var(--font-sans);
}

.btn-feedback:hover {
    color: var(--color-text);
    background-color: var(--color-surface-hover);
    border-color: var(--color-border-hover);
}

.btn-feedback svg {
    flex-shrink: 0;
}

/* ── Feedback Modal ── */
.feedback-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-slow) var(--ease-default);
}

.feedback-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.feedback-modal {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-2xl);
    transform: scale(0.95) translateY(10px);
    transition: all var(--duration-slow) var(--ease-spring);
}

.feedback-modal-overlay.active .feedback-modal {
    transform: scale(1) translateY(0);
}

.feedback-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--color-border-light);
}

.feedback-modal-header h3 {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-text);
}

.feedback-modal-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color var(--duration-fast) var(--ease-default);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
}

.feedback-modal-close:hover {
    color: var(--color-text);
    background-color: var(--color-surface-active);
}

.feedback-form {
    padding: var(--space-6);
}

.feedback-form-group {
    margin-bottom: var(--space-5);
}

.feedback-form-group label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text);
}

.feedback-form-group .required {
    color: var(--color-error);
}

.feedback-form-group input,
.feedback-form-group select,
.feedback-form-group textarea {
    width: 100%;
    padding: 10px var(--space-3);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: var(--text-sm);
    font-family: var(--font-sans);
    transition: all var(--duration-fast) var(--ease-default);
    box-sizing: border-box;
}

.feedback-form-group input:focus,
.feedback-form-group select:focus,
.feedback-form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.feedback-form-group input::placeholder,
.feedback-form-group textarea::placeholder {
    color: var(--color-text-muted);
}

.feedback-form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 2.5rem;
}

.feedback-form-group select option {
    background-color: var(--color-surface);
    color: var(--color-text);
}

.feedback-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.feedback-form-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
    padding-top: var(--space-2);
}

.feedback-form-actions .btn-cancel {
    padding: 10px var(--space-5);
    background-color: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
    font-family: var(--font-sans);
}

.feedback-form-actions .btn-cancel:hover {
    background-color: var(--color-surface-hover);
    color: var(--color-text);
}

.feedback-form-actions .btn-submit {
    padding: 10px var(--space-5);
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
    font-family: var(--font-sans);
}

.feedback-form-actions .btn-submit:hover:not(:disabled) {
    background: var(--color-primary-hover);
    box-shadow: var(--shadow-sm);
}

.feedback-form-actions .btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.feedback-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12) var(--space-8);
    text-align: center;
}

.feedback-success svg {
    color: var(--color-success);
    margin-bottom: var(--space-4);
}

.feedback-success p {
    color: var(--color-text);
    font-size: var(--text-lg);
    font-weight: 500;
    margin: 0 0 var(--space-6) 0;
}

.feedback-success .btn-submit {
    padding: 10px var(--space-8);
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
}

.feedback-success .btn-submit:hover {
    background: var(--color-primary-hover);
}

/* ── Flash Messages ── */
.messages-container {
    position: fixed;
    top: 76px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    width: 90%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-lg);
    animation: alertSlideIn var(--duration-slow) var(--ease-out);
}

.alert-error   { border-left: 3px solid var(--color-error);   }
.alert-success { border-left: 3px solid var(--color-success); }
.alert-warning { border-left: 3px solid var(--color-warning); }
.alert-info    { border-left: 3px solid var(--color-info);    }

.message-text {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text);
}

.close-alert {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast) var(--ease-default);
}

.close-alert:hover {
    color: var(--color-text);
    background-color: var(--color-surface-active);
}

/* ── Animations ── */
@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes alertSlideIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .site-header {
        padding: 0 var(--space-4);
    }

    .navbar {
        gap: var(--space-1);
    }

    .btn-feedback span,
    .org-name {
        display: none;
    }

    .active-org-badge {
        padding: 6px var(--space-3);
    }

    .dropdown-toggle {
        font-size: var(--text-xs);
        padding: 6px var(--space-2);
    }

    .btn {
        padding: var(--space-2) var(--space-3);
        font-size: var(--text-xs);
    }
}
