﻿.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .popup-overlay.show {
        opacity: 1;
        visibility: visible;
    }

.popup {
    position: relative;
    width: 90%;
    max-width: 420px;
    background-color: var(--background, #ffffff);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10000;
    overflow: hidden;
    border: 1px solid var(--border-color, #e5e7eb);
}

    .popup.show {
        opacity: 1;
        transform: scale(1);
    }

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    color: white;
    background: var(--primary, #3b82f6);
}

    .popup-header.success {
        background: var(--success, #10b981);
    }

    .popup-header.error {
        background: var(--danger, #ef4444);
    }

    .popup-header.info {
        background: var(--primary, #3b82f6);
    }

    .popup-header h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
        color: white;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .popup-header.success h3::before {
        content: "✓";
        font-size: 20px;
        font-weight: bold;
        color: white;
    }

    .popup-header.error h3::before {
        content: "✕";
        font-size: 18px;
        font-weight: bold;
        color: white;
    }

    .popup-header.info h3::before {
        content: "ℹ";
        font-size: 18px;
        font-weight: bold;
        color: white;
    }

.popup-body {
    padding: 24px 20px;
    color: var(--text-dark, #374151);
    font-size: 15px;
    line-height: 1.6;
}

    .popup-body p {
        margin: 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

.popup-footer {
    padding: 12px 20px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color, #e5e7eb);
    background-color: var(--input-bg, #f9fafb);
}

.close-popup {
    background: none;
    border: none;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
    font-weight: 300;
}

    .close-popup:hover {
        background-color: rgba(255, 255, 255, 0.2);
        color: white;
        transform: scale(1.1);
    }

    .close-popup:active {
        transform: scale(0.95);
    }

.close-popup-btn {
    background-color: var(--primary, #3b82f6);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    min-width: 70px;
}

    .close-popup-btn:hover {
        background-color: var(--primary-dark, #2563eb);
    }

body.popup-open {
    overflow: hidden;
}

    body.popup-open > *:not(.popup):not(.popup-overlay):not(.plan-limit-overlay):not(.plan-limit-popup) {
        filter: blur(2px);
        transition: filter 0.3s ease;
    }

.ghlm-error-view {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--background, #ffffff) 0%, #f5f5ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.error-wrapper {
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color, #e5e7eb);
    overflow: hidden;
    transition: max-width 0.3s ease;
}

    .error-wrapper.expanded {
        max-width: 900px;
    }

.error-content {
    padding: 1rem 1rem;
    text-align: center;
}

.error-icon {
    width: 64px;
    height: 64px;
    background-color: var(--danger, #ef4444);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

    .error-icon i {
        font-size: 2rem;
        color: white;
    }

.error-info h2 {
    color: var(--text-dark, #374151);
    font-size: 1.75rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.error-info p {
    color: var(--text-dark, #374151);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.demo-toggle-btn {
    background: var(--primary, #3b82f6);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
    justify-content: center;
}

    .demo-toggle-btn:hover {
        background: var(--primary-dark, #2563eb);
    }

.demo-toggle-icon {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.demo-toggle-btn.expanded .demo-toggle-icon {
    transform: rotate(180deg);
}

.demo-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding-top 0.3s ease;
    opacity: 0;
    padding: 0 2rem;
}

    .demo-section.expanded {
        max-height: 600px;
        opacity: 1;
        padding-top: 24px;
        padding-bottom: 2rem;
    }

.demo-frame {
    width: 100%;
    height: 430px;
    border-radius: 8px;
    overflow: hidden;
}

    .demo-frame iframe {
        width: 100%;
        height: 100%;
        border: none;
    }

.success-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--background, #ffffff) 0%, #f5f5ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
    overflow-y: auto;
}

.success-content {
    text-align: center;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

    .success-content h2 {
        color: var(--text-dark, #374151);
        font-size: 2rem;
        margin-bottom: 1rem;
        font-weight: 700;
        line-height: 1.3;
    }

    .success-content p {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }

.success-connection-details {
    background: var(--input-bg, #f9fafb);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.success-connection-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    gap: 1rem;
}

    .success-connection-item:last-child {
        border-bottom: none;
    }

    .success-connection-item i {
        font-size: 1.1rem;
        color: #10b981;
        width: 20px;
        text-align: center;
    }

    .success-connection-item span {
        font-size: 0.9rem;
        color: #374151;
        font-weight: 500;
    }

    .success-connection-item strong {
        color: var(--primary-dark, #1e40af);
        font-weight: 600;
    }

.success-disconnect-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-left: 0.5rem;
}

    .success-disconnect-btn:hover {
        background: #dc2626;
    }

    .success-disconnect-btn:active {
        background: #b91c1c;
    }

.success-icon {
    font-size: 4rem;
    color: var(--success, #10b981);
    margin-bottom: 1.5rem;
    animation: scaleIn 0.5s ease;
}

.success-wrapper {
    background: white;
    border-radius: 24px;
    padding: 1rem;
    width: 100%;
    max-width: 800px;
    margin: auto;
}

.back-button {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    border-radius: 6px;
    border: 1px solid var(--border-color, #e5e7eb);
    background-color: var(--background, #ffffff);
    color: var(--text-dark, #374151);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

    .back-button:hover {
        background-color: var(--input-bg, #f9fafb);
        border-color: var(--primary, #3b82f6);
        color: var(--primary, #3b82f6);
    }

    .back-button i {
        font-size: 0.875rem;
    }

.detail-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

    .detail-item:last-child {
        margin-bottom: 0;
    }

    .detail-item i {
        font-size: 1.25rem;
        color: var(--primary, #3b82f6);
    }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

#createConnectionForm {
    animation: slideDown 0.35s ease;
}

@media (max-width: 768px) {
    .popup {
        max-width: 95%;
        width: 95%;
        margin: 1rem;
    }

    .popup-header {
        padding: 14px 18px;
    }

    .popup-header h3 {
        font-size: 16px;
    }

    .popup-body {
        padding: 20px 18px;
        font-size: 14px;
    }

    .popup-footer {
        padding: 10px 18px;
    }

    .close-popup {
        width: 28px;
        height: 28px;
        font-size: 20px;
    }

    .ghlm-error-view {
        padding: 1rem;
    }

    .error-content {
        padding: 2rem 1.5rem;
    }

    .error-icon {
        width: 56px;
        height: 56px;
    }

        .error-icon i {
            font-size: 1.75rem;
        }

    .error-info h2 {
        font-size: 1.5rem;
    }

    .error-info p {
        font-size: 0.9rem;
    }

    .success-wrapper {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }

    .success-content h2 {
        font-size: 1.5rem;
    }

    .demo-section.expanded {
        max-height: 400px;
        padding-top: 16px;
    }

    .demo-frame {
        height: 350px;
    }

    .demo-toggle-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .back-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .popup {
        max-width: 98%;
        width: 98%;
        margin: 0.5rem;
        border-radius: 10px;
    }

    .popup-header {
        padding: 12px 16px;
    }

    .popup-header h3 {
        font-size: 15px;
    }

    .popup-body {
        padding: 18px 16px;
        font-size: 13px;
    }

    .popup-footer {
        padding: 10px 16px;
    }

    .close-popup {
        width: 26px;
        height: 26px;
        font-size: 18px;
    }

    .close-popup-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .ghlm-error-view {
        padding: 0.5rem;
    }

    .error-content {
        padding: 1.5rem 1rem;
    }

    .error-info h2 {
        font-size: 1.25rem;
    }

    .error-info p {
        font-size: 0.875rem;
    }

    .error-icon {
        width: 48px;
        height: 48px;
    }

        .error-icon i {
            font-size: 1.5rem;
        }

    .success-wrapper {
        margin: 0.5rem;
        padding: 1.5rem 1rem;
    }

    .success-content h2 {
        font-size: 1.25rem;
    }

    .success-content p {
        font-size: 0.875rem;
    }

    .demo-section.expanded {
        max-height: 300px;
        padding-top: 12px;
    }

    .demo-frame {
        height: 250px;
    }

    .demo-toggle-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .back-button {
        padding: 0.5rem;
        border-radius: 50%;
        width: 2.5rem;
        height: 2.5rem;
        justify-content: center;
    }

        .back-button i {
            margin: 0;
            font-size: 0.875rem;
        }

        .back-button span {
            display: none;
        }

    .detail-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}

@media (max-width: 320px) {
    .close-popup-btn {
        padding: 6px 16px;
        font-size: 13px;
    }

    .popup-body {
        padding: 16px;
    }

        .popup-body p {
            font-size: 13px;
        }

    .popup-header {
        padding: 12px 16px;
    }

        .popup-header h3 {
            font-size: 16px;
        }
}

@media (max-height: 600px) {
    .success-view {
        align-items: flex-start;
    }

    .success-wrapper {
        margin: 1rem auto;
    }
}
#demo-canvas {
    margin: 0 !important;
    padding: 0 !important;
}


.plan-limit-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.plan-limit-overlay.show {
    opacity: 1;
}

.plan-limit-popup {
    background: white;
    border-radius: 12px;
    max-width: 550px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px !important;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease, max-width 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.plan-limit-popup.show {
    transform: translateY(0);
}

.plan-limit-popup.demo-expanded {
    max-width: 900px !important;
    padding: 20px !important;
}

.plan-limit-popup * {
    filter: none !important;
    backdrop-filter: none !important;
}

.close-plan-popup {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f3f4f6;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    width: 36px;
    height: 36px;
    margin-bottom: 2px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    z-index: 10;
}

.close-plan-popup:hover {
    background: #fee2e2;
    color: #dc2626;
}

.plan-limit-error-content {
    text-align: center !important;
    margin-bottom: 16px !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.plan-limit-popup.demo-expanded .plan-limit-error-content {
    margin-bottom: 8px !important;
}

.plan-limit-error-icon {
    width: 64px !important;
    height: 64px !important;
    background-color: #dc2626 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto 12px !important;
}

.plan-limit-popup.demo-expanded .plan-limit-error-icon {
    margin-bottom: 8px !important;
}

.plan-limit-error-icon i {
    font-size: 2rem !important;
    color: white !important;
}

.plan-limit-error-info {
    text-align: center !important;
    width: 100% !important;
}

.plan-limit-error-info h2 {
    margin: 0 0 10px 0 !important;
    font-size: 1.5rem !important;
    color: #111827 !important;
    font-weight: 700 !important;
    text-align: center !important;
}

.plan-limit-popup.demo-expanded .plan-limit-error-info h2 {
    margin-bottom: 6px !important;
    font-size: 1.25rem !important;
}

.plan-limit-error-info p {
    margin: 8px 0 !important;
    color: #6b7280 !important;
    line-height: 1.5 !important;
    font-size: 0.9375rem !important;
    text-align: center !important;
}

.plan-limit-popup.demo-expanded .plan-limit-error-info p {
    font-size: 0.875rem !important;
    line-height: 1.4 !important;
    margin: 15px 0 !important;
}

.plan-limit-demo-toggle-btn {
    background: var(--primary) !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    box-shadow: 0 4px 12px rgba(0, 62, 197, 0.3) !important;
    width: 100% !important;
    margin: 0 !important;
}

.plan-limit-demo-toggle-btn:hover {
    background: #001f99 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(0, 62, 197, 0.4) !important;
}

.plan-limit-demo-toggle-icon {
    transition: transform 0.3s ease !important;
    font-size: 0.875rem !important;
}

.plan-limit-demo-section {
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.5s ease !important;
    margin: 0 !important;
    padding: 0 !important;
}

.plan-limit-demo-section.expanded {
    max-height: 600px !important;
    margin-top: 6px !important;
}

.plan-limit-demo-iframe {
    width: 100% !important;
    height: 600px !important;
    border: none !important;
    border-radius: 8px !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

@media (max-width: 768px) {
    .plan-limit-popup {
        max-width: 95% !important;
        padding: 24px !important;
    }
    
    .plan-limit-popup.demo-expanded {
        max-width: 95% !important;
        padding: 16px !important;
    }
    
    .plan-limit-demo-section.expanded {
        max-height: 420px !important;
    }
    
    .plan-limit-demo-iframe {
        height: 420px !important;
    }
    
    .plan-limit-error-icon {
        width: 56px !important;
        height: 56px !important;
    }
    
    .plan-limit-error-icon i {
        font-size: 1.75rem !important;
    }
}