/* ==========================================================================
   Global Menu - Unified Header System
   Shared across Investor Portal (.php) and Admin Portal (admin.html)
   ========================================================================== */

/* CSS Variables for consistent theming */
:root {
    --gm-primary: #0047FF;
    --gm-primary-light: #47B5FF;
    --gm-dark: #0A0A0F;
    --gm-dark-surface: #121218;
    --gm-dark-border: rgba(255, 255, 255, 0.1);
    --gm-text: #ffffff;
    --gm-text-muted: #9ca3af;
    --gm-header-height: 60px;
    --gm-subheader-height: 44px;
}

/* ==========================================================================
   Main Header - Brand + Navigation
   ========================================================================== */

.global-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #1a1a22 0%, var(--gm-dark) 100%);
    border-bottom: 1px solid var(--gm-dark-border);
    /* Override shared.css flex row - stack main nav and subheader vertically */
    display: flex;
    flex-direction: column;
}

.global-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--gm-header-height);
    padding: 0 2rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Brand */
.global-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--gm-text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.global-brand:hover {
    color: var(--gm-primary-light);
}

/* Main Navigation */
.global-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.global-nav a {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gm-text-muted);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.global-nav a:hover {
    color: var(--gm-text);
    background: rgba(255, 255, 255, 0.05);
}

.global-nav a.active {
    color: var(--gm-primary-light);
    background: rgba(71, 181, 255, 0.1);
}

/* Nav separator (visual only) */
.global-nav-separator {
    width: 1px;
    height: 20px;
    background: var(--gm-dark-border);
    margin: 0 0.25rem;
}

/* ==========================================================================
   Sub Header - Portal Type + User Info
   ========================================================================== */

.global-subheader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--gm-subheader-height);
    padding: 0 2rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Portal Label */
.global-portal-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gm-text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.global-portal-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.global-portal-badge.investor {
    background: rgba(71, 181, 255, 0.2);
    color: var(--gm-primary-light);
}

.global-portal-badge.admin {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* User Info */
.global-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
}

.global-user-email {
    color: var(--gm-text-muted);
}

.global-user-role {
    color: var(--gm-text);
    font-weight: 500;
    padding: 0.15rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.global-user-role.tier-1 {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

.global-user-role.tier-2 {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.global-user-role.owner {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.global-signout {
    color: var(--gm-text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--gm-dark-border);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.global-signout:hover {
    color: var(--gm-text);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Welcome Bar - under main nav */
.global-welcome-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.5rem 2rem;
    background: rgba(0, 71, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
}

.global-welcome-text {
    color: var(--gm-text-muted);
}

.global-welcome-text strong {
    color: var(--gm-text);
    font-weight: 500;
}

.global-welcome-bar .global-signout {
    margin-left: 1rem;
}

/* Admin Refresh Button */
.admin-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--gm-dark-border);
    border-radius: 6px;
    color: var(--gm-text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.admin-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--gm-text);
}

.admin-refresh-btn svg {
    width: 16px;
    height: 16px;
}

.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* ==========================================================================
   Body Spacing - Account for fixed header
   ========================================================================== */

.global-header-spacer {
    height: calc(var(--gm-header-height) + var(--gm-subheader-height) + 36px);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .global-header-main {
        flex-direction: column;
        height: auto;
        padding: 1rem;
        gap: 0.75rem;
    }

    .global-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }

    .global-nav a {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }

    .global-nav-separator {
        display: none;
    }

    .global-subheader {
        flex-direction: column;
        height: auto;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .global-user-info {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .global-header-spacer {
        height: 160px; /* Approximate for mobile */
    }
}

@media (max-width: 480px) {
    .global-brand {
        font-size: 1.15rem;
    }

    .global-nav a {
        font-size: 0.75rem;
        padding: 0.35rem 0.5rem;
    }

    .global-header-spacer {
        height: 180px;
    }
}

/* ==========================================================================
   Feedback Slide-out Panel
   ========================================================================== */

.feedback-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
}

.feedback-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(168, 85, 247, 0.5);
}

.feedback-trigger svg {
    width: 24px;
    height: 24px;
    color: white;
}

.feedback-trigger.active {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    cursor: default;
}

.feedback-trigger.active:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(107, 114, 128, 0.4);
}

/* Slide-out Panel */
.feedback-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 360px;
    max-width: calc(100vw - 48px);
    background: var(--gm-dark-surface, #121218);
    border: 1px solid var(--gm-dark-border, rgba(255, 255, 255, 0.1));
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.feedback-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gm-dark-border, rgba(255, 255, 255, 0.1));
}

.feedback-panel-header h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gm-text, #ffffff);
    margin: 0;
}

.feedback-close {
    background: none;
    border: none;
    color: var(--gm-text-muted, #9ca3af);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.feedback-close:hover {
    color: var(--gm-text, #ffffff);
    background: rgba(255, 255, 255, 0.1);
}

.feedback-close svg {
    width: 20px;
    height: 20px;
}

.feedback-panel-body {
    padding: 1.25rem;
}

.feedback-tagline {
    font-size: 0.9rem;
    color: var(--gm-text-muted, #9ca3af);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

/* Star Rating */
.feedback-rating {
    margin-bottom: 1.25rem;
}

.feedback-rating-label {
    display: block;
    font-size: 0.85rem;
    color: var(--gm-text-muted, #9ca3af);
    margin-bottom: 0.5rem;
}

.feedback-stars {
    display: flex;
    gap: 0.25rem;
}

.feedback-star {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.feedback-star:hover,
.feedback-star.active {
    color: #fbbf24;
}

.feedback-star svg {
    width: 28px;
    height: 28px;
}

/* Message Textarea */
.feedback-message {
    width: 100%;
    min-height: 100px;
    padding: 0.875rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--gm-dark-border, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    color: var(--gm-text, #ffffff);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.feedback-message:focus {
    outline: none;
    border-color: #a855f7;
}

.feedback-message::placeholder {
    color: var(--gm-text-muted, #9ca3af);
}

/* Send Button */
.feedback-panel-footer {
    padding: 0 1.25rem 1.25rem;
}

.feedback-send {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.feedback-send:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

.feedback-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.feedback-send svg {
    width: 18px;
    height: 18px;
}

/* Success State */
.feedback-success {
    text-align: center;
    padding: 2rem 1rem;
}

.feedback-success-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.feedback-success-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.feedback-success h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    color: var(--gm-text, #ffffff);
    margin-bottom: 0.5rem;
}

.feedback-success p {
    color: var(--gm-text-muted, #9ca3af);
    font-size: 0.9rem;
}

@media (max-width: 480px) {
    .feedback-panel {
        width: calc(100vw - 32px);
        right: 16px;
        bottom: 16px;
    }

    .feedback-trigger {
        right: 16px;
        bottom: 16px;
        width: 48px;
        height: 48px;
    }

    .feedback-trigger svg {
        width: 20px;
        height: 20px;
    }
}
