/* Main Demo Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: #f1f1f1;
    color: #333;
}

/* Demo Navigation */
.demo-navigation {
    background: #fff;
    padding: 20px;
    border-bottom: 1px solid #ddd;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.demo-navigation h1 {
    margin-bottom: 20px;
    color: #2271b1;
    font-size: 28px;
}

.demo-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.demo-tab {
    padding: 12px 24px;
    border: 2px solid #2271b1;
    background: #fff;
    color: #2271b1;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.demo-tab:hover {
    background: #2271b1;
    color: #fff;
}

.demo-tab.active {
    background: #2271b1;
    color: #fff;
}

/* Tab Content */
.demo-tab-content {
    display: none;
    margin: 0 auto;
}

.demo-tab-content.active {
    display: block;
}

/* Demo Tab Buttons */
.demo-tab-btn {
    padding: 12px 24px;
    border: 2px solid #2271b1;
    background: #fff;
    color: #2271b1;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.demo-tab-btn:hover {
    background: #2271b1;
    color: #fff;
}

.demo-tab-btn.active {
    background: #2271b1;
    color: #fff;
}

/* Common Styles */
.button {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #ccc;
    background: #f7f7f7;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.button:hover {
    background: #e7e7e7;
}

.button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.button-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

.regular-text {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

/* Instructions Icon */
.instructions-icon-link {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.instructions-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.instructions-icon:hover {
    transform: scale(1.1);
}

/* External Data Notice */
.imgaipress-external-data-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
    position: relative;
    color: #856404;
}

.external-data-notice-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #856404;
}

/* Credit Boxes */
.imgaipress-image-credit-box,
.imgaipress-bg-credit-box,
.imgaipress-edit-credit-box,
.imgaipress-upscaler-credit-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 20px 0;
    text-align: center;
    font-weight: 600;
}

.credit-value {
    color: #2271b1;
    font-weight: bold;
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.imgaipress-ai-image-progress {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ==========================================================================
   TUTORIAL GUIDE SYSTEM
   ========================================================================== */
.tutorial-guide {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 15px;
}

.tutorial-next-btn {
    background: linear-gradient(135deg, #2271b1, #135e96);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(34, 113, 177, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tutorial-next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(34, 113, 177, 0.4);
    background: linear-gradient(135deg, #135e96, #0f4a73);
}

.tutorial-next-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.tutorial-tooltip {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    max-width: 300px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: tooltipFadeIn 0.3s ease;
}

.tutorial-tooltip::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 8px solid rgba(0, 0, 0, 0.9);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Highlight elements during tutorial */
.tutorial-highlight {
    position: relative;
    z-index: 10000;
    box-shadow: 0 0 0 3px #2271b1, 0 0 20px rgba(34, 113, 177, 0.3) !important;
    border-radius: 8px;
    animation: tutorialPulse 2s infinite;
}

@keyframes tutorialPulse {
    0%, 100% {
        box-shadow: 0 0 0 3px #2271b1, 0 0 20px rgba(34, 113, 177, 0.3);
    }
    50% {
        box-shadow: 0 0 0 6px #2271b1, 0 0 30px rgba(34, 113, 177, 0.5);
    }
}

.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999 !important;
    pointer-events: none;
}

/* Smooth transitions for tutorial */
* {
    transition: box-shadow 0.3s ease, opacity 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .demo-navigation {
        padding: 15px;
    }
    
    .demo-navigation h1 {
        font-size: 24px;
        margin-bottom: 15px;
    }
    
    .demo-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .demo-tab {
        min-width: 200px;
    }
    
    .tab-content {
        padding: 15px;
    }
    
    .tutorial-guide {
        bottom: 20px;
        right: 20px;
        flex-direction: column;
        align-items: flex-end;
    }
    
    .tutorial-tooltip {
        max-width: 250px;
        font-size: 13px;
    }
    
    .tutorial-next-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}