/**
 * Demo Components Stylesheet
 *
 * Styling for DemoBanner and UpgradePrompt components
 */

/* =============================================================================
   Demo Badge (Small pill next to logo)
   ============================================================================= */

#demo-badge-container {
    display: none; /* Hidden by default, shown by JS for demo users */
    align-items: center;
    margin-left: 12px;
}

.demo-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-decoration: none;
    transition: all 0.2s ease;
    gap: 6px;
}

.demo-badge:hover {
    background: rgba(255, 255, 255, 0.3);
    text-decoration: none;
    color: white;
}

.demo-badge-content {
    display: flex;
    align-items: center;
    gap: 6px;
}

.demo-badge-icon {
    display: none; /* Hide icon for cleaner look */
}

.demo-badge-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.demo-badge-text strong {
    font-size: 11px;
    font-weight: 600;
}

.demo-badge-limits {
    display: none; /* Hide limits in header - shown elsewhere */
}

.demo-badge-upgrade-btn {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: white;
    color: #368BC1;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 10px;
    transition: all 0.2s ease;
    margin-left: 4px;
}

.demo-badge-upgrade-btn:hover {
    background: #f0f0f0;
    color: #2a7ab0;
}

/* Mobile responsive - even more compact */
@media (max-width: 768px) {
    #demo-badge-container {
        margin-left: 8px;
    }

    .demo-badge {
        padding: 3px 8px;
        font-size: 10px;
        border-radius: 10px;
    }

    .demo-badge-text strong {
        font-size: 10px;
    }

    .demo-badge-upgrade-btn {
        padding: 2px 6px;
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    /* On very small screens, just show "DEMO" text as a link */
    .demo-badge-upgrade-btn {
        display: none;
    }

    .demo-badge {
        padding: 2px 6px;
        font-size: 9px;
    }
}

/* =============================================================================
   Demo Banner (Legacy - Full Width)
   ============================================================================= */

.demo-banner {
    background: var(--primary-color, #368BC1);
    color: #ffffff;
    padding: 16px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: demo-banner-slide-down 0.3s ease-out;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    border-radius: 0 0 8px 8px;
    margin: 0;
}

@keyframes demo-banner-slide-down {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.demo-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.demo-banner-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.9);
}

.demo-banner-text {
    flex: 1;
    line-height: 1.5;
}

.demo-banner-text strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.demo-banner-text > span {
    display: block;
    font-size: 14px;
    opacity: 0.95;
    margin-bottom: 8px;
}

.demo-limits {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    opacity: 0.9;
}

.demo-limits li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.demo-limits li::before {
    content: '•';
    font-size: 16px;
}

.demo-banner-upgrade-btn {
    flex-shrink: 0;
    padding: 10px 24px;
    background: #ffffff;
    color: var(--primary-color, #368BC1);
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.demo-banner-upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    color: var(--primary-hover, #2a7ab0);
}

.demo-banner-dismiss {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-banner-dismiss:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .demo-banner {
        padding: 12px 16px;
    }

    .demo-banner-content {
        flex-wrap: wrap;
        gap: 12px;
    }

    .demo-limits {
        flex-direction: column;
        gap: 8px;
    }

    .demo-banner-upgrade-btn {
        width: 100%;
        text-align: center;
        order: 1;
    }

    .demo-banner-dismiss {
        order: -1;
        margin-left: auto;
    }
}

/* =============================================================================
   Upgrade Prompt - Modal
   ============================================================================= */

.upgrade-prompt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fade-in 0.2s ease-out;
    padding: 20px;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.upgrade-prompt-modal {
    background: #ffffff;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modal-slide-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-slide-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.upgrade-prompt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.upgrade-prompt-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
}

.upgrade-prompt-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    color: #718096;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upgrade-prompt-close:hover {
    background: #f7fafc;
    color: #2d3748;
}

.upgrade-prompt-body {
    padding: 32px 24px;
    text-align: center;
}

.upgrade-prompt-icon {
    color: var(--primary-color, #368BC1);
    margin-bottom: 16px;
}

.upgrade-prompt-icon svg {
    width: 48px;
    height: 48px;
}

.upgrade-prompt-message {
    font-size: 16px;
    color: #2d3748;
    margin: 0 0 8px 0;
    line-height: 1.6;
}

.upgrade-prompt-detail {
    font-size: 14px;
    color: #718096;
    margin: 8px 0 0 0;
    line-height: 1.5;
}

.upgrade-prompt-actions {
    padding: 16px 24px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.upgrade-prompt-btn {
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.upgrade-prompt-btn-primary {
    background: var(--primary-color, #368BC1) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(54, 139, 193, 0.4);
}

.upgrade-prompt-btn-primary:hover {
    background: var(--primary-hover, #2a7ab0) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(54, 139, 193, 0.4);
}

.upgrade-prompt-btn-secondary {
    background: #f7fafc;
    color: #4a5568;
}

.upgrade-prompt-btn-secondary:hover {
    background: #edf2f7;
}

/* =============================================================================
   Upgrade Prompt - Inline
   ============================================================================= */

.upgrade-prompt-inline {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px solid #cbd5e0;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    gap: 16px;
    align-items: center;
    animation: fade-in 0.3s ease-out;
}

.upgrade-prompt-inline-icon {
    flex-shrink: 0;
    color: var(--primary-color, #368BC1);
}

.upgrade-prompt-inline-icon svg {
    width: 24px;
    height: 24px;
}

.upgrade-prompt-inline-content {
    flex: 1;
}

.upgrade-prompt-inline-content p {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #2d3748;
    line-height: 1.6;
}

.upgrade-prompt-inline-btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--primary-color, #368BC1);
    color: #ffffff;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(54, 139, 193, 0.3);
}

.upgrade-prompt-inline-btn:hover {
    background: var(--primary-hover, #2a7ab0);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(54, 139, 193, 0.4);
}

/* =============================================================================
   Upgrade Prompt - Toast
   ============================================================================= */

.upgrade-prompt-toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #2d3748;
    color: #ffffff;
    border-radius: 8px;
    padding: 16px 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    max-width: 500px;
    width: calc(100% - 40px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.upgrade-prompt-toast-top {
    top: 20px;
}

.upgrade-prompt-toast-bottom {
    top: auto;
    bottom: 20px;
    transform: translateX(-50%) translateY(100px);
}

.upgrade-prompt-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0) !important;
}

.upgrade-prompt-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upgrade-prompt-toast-content svg {
    flex-shrink: 0;
    color: #fbbf24;
}

.upgrade-prompt-toast-content span {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

.upgrade-prompt-toast-btn {
    flex-shrink: 0;
    padding: 6px 16px;
    background: var(--primary-color, #368BC1);
    color: #ffffff;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
}

.upgrade-prompt-toast-btn:hover {
    background: var(--primary-hover, #2a7ab0);
}

/* =============================================================================
   Mobile Responsive
   ============================================================================= */

@media (max-width: 640px) {
    .upgrade-prompt-modal {
        margin: 20px;
        max-width: calc(100% - 40px);
    }

    .upgrade-prompt-actions {
        flex-direction: column;
        padding: 16px;
    }

    .upgrade-prompt-btn {
        width: 100%;
        padding: 12px 16px;
        box-sizing: border-box;
        white-space: normal;
        text-align: center;
    }

    .upgrade-prompt-inline {
        flex-direction: column;
        text-align: center;
    }

    .upgrade-prompt-toast {
        width: calc(100% - 32px);
    }
}

/* =============================================================================
   Dark Mode Support
   ============================================================================= */

/* Manual dark mode toggle */
html.dark-mode .upgrade-prompt-modal {
    background: #1a202c;
}

html.dark-mode .upgrade-prompt-header {
    border-bottom-color: #2d3748;
}

html.dark-mode .upgrade-prompt-header h2,
html.dark-mode .upgrade-prompt-message {
    color: #f7fafc;
}

html.dark-mode .upgrade-prompt-detail {
    color: #cbd5e0;
}

html.dark-mode .upgrade-prompt-close {
    color: #cbd5e0;
}

html.dark-mode .upgrade-prompt-close:hover {
    background: #2d3748;
    color: #f7fafc;
}

html.dark-mode .upgrade-prompt-btn-primary {
    background: var(--primary-color, #368BC1) !important;
    color: #ffffff !important;
}

html.dark-mode .upgrade-prompt-btn-primary:hover {
    background: var(--primary-hover, #2a7ab0) !important;
}

html.dark-mode .upgrade-prompt-btn-secondary {
    background: #2d3748;
    color: #f7fafc;
}

html.dark-mode .upgrade-prompt-btn-secondary:hover {
    background: #4a5568;
}

html.dark-mode .upgrade-prompt-inline {
    background: #2d3748;
    border-color: #4a5568;
}

html.dark-mode .upgrade-prompt-inline-content p {
    color: #f7fafc;
}

html.dark-mode .upgrade-prompt-toast {
    background: #2d3748;
}

html.dark-mode .upgrade-prompt-overlay {
    background: rgba(0, 0, 0, 0.75);
}

/* Demo Badge (Small Pill) - Dark Mode */
html.dark-mode .demo-badge {
    background: rgba(54, 139, 193, 0.3);
    border-color: rgba(54, 139, 193, 0.5);
    color: #7dd3fc;
}

html.dark-mode .demo-badge:hover {
    background: rgba(54, 139, 193, 0.4);
    color: #bae6fd;
}

html.dark-mode .demo-badge-upgrade-btn {
    background: #368BC1;
    color: white;
}

html.dark-mode .demo-badge-upgrade-btn:hover {
    background: #2a7ab0;
    color: white;
}

/* Demo Banner (Full Width) - Dark Mode */
html.dark-mode .demo-banner {
    background: var(--primary-color, #368BC1) !important;
}

html.dark-mode .demo-banner-text strong {
    color: #f3f4f6 !important;
}

html.dark-mode .demo-banner-text > span {
    color: rgba(243, 244, 246, 0.9) !important;
}

html.dark-mode .demo-limits li {
    color: rgba(243, 244, 246, 0.85) !important;
}

/* Auto dark mode (follows system preference) */
@media (prefers-color-scheme: dark) {
    html.dark-mode-auto .upgrade-prompt-modal {
        background: #1a202c;
    }

    html.dark-mode-auto .upgrade-prompt-header {
        border-bottom-color: #2d3748;
    }

    html.dark-mode-auto .upgrade-prompt-header h2,
    html.dark-mode-auto .upgrade-prompt-message {
        color: #f7fafc;
    }

    html.dark-mode-auto .upgrade-prompt-detail {
        color: #cbd5e0;
    }

    html.dark-mode-auto .upgrade-prompt-close {
        color: #cbd5e0;
    }

    html.dark-mode-auto .upgrade-prompt-close:hover {
        background: #2d3748;
        color: #f7fafc;
    }

    html.dark-mode-auto .upgrade-prompt-btn-primary {
        background: var(--primary-color, #368BC1) !important;
        color: #ffffff !important;
    }

    html.dark-mode-auto .upgrade-prompt-btn-primary:hover {
        background: var(--primary-hover, #2a7ab0) !important;
    }

    html.dark-mode-auto .upgrade-prompt-btn-secondary {
        background: #2d3748;
        color: #f7fafc;
    }

    html.dark-mode-auto .upgrade-prompt-btn-secondary:hover {
        background: #4a5568;
    }

    html.dark-mode-auto .upgrade-prompt-inline {
        background: #2d3748;
        border-color: #4a5568;
    }

    html.dark-mode-auto .upgrade-prompt-inline-content p {
        color: #f7fafc;
    }

    html.dark-mode-auto .upgrade-prompt-toast {
        background: #2d3748;
    }

    html.dark-mode-auto .upgrade-prompt-overlay {
        background: rgba(0, 0, 0, 0.75);
    }

    /* Demo Badge (Small Pill) - Auto Dark Mode */
    html.dark-mode-auto .demo-badge {
        background: rgba(54, 139, 193, 0.3);
        border-color: rgba(54, 139, 193, 0.5);
        color: #7dd3fc;
    }

    html.dark-mode-auto .demo-badge:hover {
        background: rgba(54, 139, 193, 0.4);
        color: #bae6fd;
    }

    html.dark-mode-auto .demo-badge-upgrade-btn {
        background: #368BC1;
        color: white;
    }

    html.dark-mode-auto .demo-badge-upgrade-btn:hover {
        background: #2a7ab0;
        color: white;
    }

    /* Demo Banner (Full Width) - Auto Dark Mode */
    html.dark-mode-auto .demo-banner {
        background: var(--primary-color, #368BC1) !important;
    }

    html.dark-mode-auto .demo-banner-text strong {
        color: #f3f4f6 !important;
    }

    html.dark-mode-auto .demo-banner-text > span {
        color: rgba(243, 244, 246, 0.9) !important;
    }

    html.dark-mode-auto .demo-limits li {
        color: rgba(243, 244, 246, 0.85) !important;
    }
}
