/**
 * 🎨 SHARED DASHBOARD COMMON CSS
 * ==============================
 * Extracted from feedback_dashboard.css for use across all BayPoint AI apps
 * 
 * Features:
 * - Theme variables (light/dark mode)
 * - Theme toggle button
 * - eBay connection status indicator
 * - Shared modal styling
 * 
 * Note: This is app-neutral. App-specific styles stay in individual apps.
 */

/* Import shared modal CSS */
@import url('modal.css');

/* ═══════════════════════════════════════════════════════════════════════════
   🎨 SHARED HEADER COMPONENT STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

.header-section {
    background: var(--bg-primary);
    padding: 0 2rem 1.5rem 2rem;
    color: var(--text-primary);
    box-shadow: 0 4px 12px var(--shadow);
    position: relative;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.header-title {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-align: left;
    color: var(--text-primary);
}

.header-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    text-align: left;
    color: var(--text-primary);
}

/* Header layout - flex with main content and user menu */
.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: nowrap;
    min-height: 60px;
}

.header-text {
    flex: 1;
    min-width: 0;
}

.header-user-menu {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    white-space: nowrap;
}

/* User info section (username and eBay ID) */
.user-info-clean {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    min-width: max-content;
}

.username-clean {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.ebay-id-clean {
    font-size: 0.8rem;
    opacity: 0.9;
    color: var(--text-primary);
}

/* Logout and Login buttons */
.btn-logout-clean,
.btn-login-clean {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    white-space: nowrap;
    box-sizing: border-box;
    height: 38px;
    display: flex;
    align-items: center;
}

.btn-logout-clean:hover,
.btn-login-clean:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* User actions menu - flex layout for buttons and icons */
.user-actions-clean {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Account settings button styling */
.btn-account-settings {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
    height: 38px;
    display: flex;
    align-items: center;
}

.btn-account-settings:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Ask Morgan button - Warm, inviting support button styling */
.btn-ask-morgan {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    box-sizing: border-box;
    height: 38px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: visible; /* Changed from hidden to show badge */
}

.btn-ask-morgan:hover {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.5);
    border-color: rgba(255, 255, 255, 0.6);
}

.btn-ask-morgan:active {
    transform: translateY(-1px);
}

/* Support ticket status badge */
.support-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 0;
    border: 2px solid #f3f4f6;
    z-index: 10;
    transition: all 0.3s ease;
}

.support-badge.has-open {
    background: #dc2626; /* Red for open tickets */
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.6);
}

.support-badge.recently-resolved {
    background: #10b981; /* Green for recently resolved */
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* Hover tooltip on badge */
.support-badge[title]:hover::after {
    content: attr(title);
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 0.75rem;
    white-space: nowrap;
    border-radius: 6px;
    z-index: 1000;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎨 THEME VARIABLES
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* Light mode (default) */
    --bg-primary: linear-gradient(135deg, #0654ba 0%, #4285f4 100%);
    --bg-secondary: rgba(255, 255, 255, 0.95);
    --bg-card: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: #1f2937;
    --text-muted: #6b7280;
    --border-color: rgba(255, 255, 255, 0.3);
    --shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    /* Ubuntu Dark Theme */
    --bg-primary: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    --bg-secondary: rgba(45, 45, 45, 0.95);
    --bg-card: rgba(60, 60, 60, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #f0f0f0;
    --text-muted: #cccccc;
    --border-color: rgba(128, 128, 128, 0.3);
    --shadow: rgba(0, 0, 0, 0.6);
}

/* ═══════════════════════════════════════════════════════════════════════════
   🌓 THEME TOGGLE BUTTON
   ═══════════════════════════════════════════════════════════════════════════ */

.theme-toggle-container {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.theme-toggle {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--shadow);
}

.theme-icon {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 1.2rem;
}

/* Show sun in light mode, hide moon */
[data-theme="light"] .light-icon {
    opacity: 1;
    transform: scale(1);
}

[data-theme="light"] .dark-icon {
    opacity: 0;
    transform: scale(0.8);
}

/* Show moon in dark mode, hide sun */
[data-theme="dark"] .light-icon {
    opacity: 0;
    transform: scale(0.8);
}

[data-theme="dark"] .dark-icon {
    opacity: 1;
    transform: scale(1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   🔗 EBAY CONNECTION STATUS INDICATOR
   ═══════════════════════════════════════════════════════════════════════════ */

.ebay-status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    box-sizing: border-box;
    height: 38px;
    font-size: 0.85rem;
    font-weight: 500;
}

.ebay-status-indicator:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ebay-status-indicator .status-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    opacity: 0.9;
    white-space: nowrap;
}

.ebay-status-indicator .status-icon {
    position: relative;
    font-size: 1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* Status dot for pulsing effect */
.status-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    z-index: 2;
}

/* Status symbol */
.status-symbol {
    position: relative;
    z-index: 3;
    font-size: 0.9rem;
}

/* Status label */
.status-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    opacity: 0.8;
    margin-left: 0.25rem;
}

/* Connected state - Green pulsing */
.status-icon.connected {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-icon.connected .status-dot {
    background: #10b981;
    animation: pulse-success 3s infinite ease-in-out;
}

.status-icon.connected .status-symbol {
    color: #10b981;
}

/* Disconnected state - Red pulsing */
.status-icon.disconnected {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.status-icon.disconnected .status-dot {
    background: #ef4444;
    animation: pulse-error 2.5s infinite ease-in-out;
}

.status-icon.disconnected .status-symbol {
    color: #ef4444;
}

/* Checking state - Spinning indicator */
.status-icon.checking {
    background: rgba(251, 191, 36, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.status-icon.checking .status-dot {
    background: #fbbf24;
    animation: pulse-checking 2s infinite ease-in-out;
}

.status-icon.checking .status-symbol {
    color: #fbbf24;
    animation: spin 1.5s linear infinite;
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎬 ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes pulse-success {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.4; 
        transform: scale(1.3);
    }
}

@keyframes pulse-error {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.3; 
        transform: scale(1.4);
    }
}

@keyframes pulse-checking {
    0%, 100% { 
        opacity: 0.6; 
        transform: scale(1);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.2);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   🚪 BACK TO APPS BUTTON (Shared Navigation)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Enhanced navigation button with icon and text - high contrast for visibility */
.back-to-apps-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin-right: 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;  /* Darker text for better contrast */
    text-decoration: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 2px solid #e5e7eb;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Door icon with left arrow via ::before pseudo-element */
.back-to-apps-btn::before {
    content: "🚪";  /* Door icon for "exit to apps" - can also use: ← ↩️ ⬅️ 🏠 */
    font-size: 1.15rem;
    line-height: 1;
}

.back-to-apps-btn:hover {
    color: #0654ba;  /* Primary blue */
    background: #f3f4f6;
    border-color: #0654ba;
    transform: translateX(-3px);
    box-shadow: 0 4px 8px rgba(6, 84, 186, 0.15);
}

.back-to-apps-btn:active {
    transform: translateX(-5px);
    box-shadow: 0 2px 4px rgba(6, 84, 186, 0.2);
}

/* Mobile responsive - keep compact but visible on smaller screens */
@media (max-width: 768px) {
    .back-to-apps-btn {
        padding: 0.45rem 0.8rem;
        font-size: 0.9rem;
        gap: 0.4rem;
    }
}
