/* Interactive Components */
.rapidviz-modes {
    display: none !important;
    justify-content: center;
    margin-bottom: 25px;
    gap: 10px;
}

.mode-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.mode-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    -webkit-transform: skewX(-25deg);
    transform: skewX(-25deg);
    -webkit-animation: shine 3s infinite;
    animation: shine 3s infinite;
    pointer-events: none;
    z-index: 10;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.mode-btn.active {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.action-controls {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    width: 100%;
}

/* Cross-browser gap support */
.action-controls > * {
    margin-right: 10px;
}

.action-controls > *:last-child {
    margin-right: 0;
}

/* Modern browsers with gap support */
@supports (gap: 10px) {
    .action-controls {
        gap: 10px;
    }
    
    .action-controls > * {
        margin-right: 0;
    }
}

.aspect-ratio-select {
    padding: 0 14px 0 0;
    border: none;
    border-radius: 0;
    font-size: 12px;
    font-weight: 400; /* Not bold */
    color: #666;
    background: transparent;
    cursor: pointer;
    transition: color 0.3s ease;
    min-width: auto;
    max-width: 110px; /* Constrain width to avoid large gaps */
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    box-shadow: none;
}

.aspect-ratio-select:hover {
    color: #333;
}

.aspect-ratio-select:focus {
    outline: none !important;
    color: #333;
}

/* Engaging Button Class (Shared) */
.rapidviz-engaging-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.rapidviz-engaging-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    -webkit-transform: skewX(-25deg);
    transform: skewX(-25deg);
    -webkit-animation: shine 3s infinite;
    animation: shine 3s infinite;
    pointer-events: none;
    z-index: 10;
}

@-webkit-keyframes shine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

.generate-button {
    -webkit-flex: 1 1 0;
    -ms-flex: 1 1 0px;
    flex: 1 1 0;
    min-width: 150px;
    padding: 15px 20px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--rapidviz-primary, #667eea) 0%, var(--rapidviz-secondary, #764ba2) 100%);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    /* display: inline-block; replaced */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    
    /* Layout Fix */
    box-sizing: border-box;
    
    /* Engaging Effect */
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Remove duplicated ::after and keyframes from .generate-button since it will use .rapidviz-engaging-btn or duplicate here */
.generate-button::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    -webkit-transform: skewX(-25deg);
    transform: skewX(-25deg);
    -webkit-animation: shine 3s infinite;
    animation: shine 3s infinite;
    pointer-events: none;
    z-index: 10;
}

.generate-button.create-new-inline {
    /* Equal sizing with generateBtn */
}

.generate-button:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.generate-button:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.generate-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

/* Minimal Circular Spinner */
.bucket-spinner {
    width: 50px;
    height: 50px;
    display: inline-block;
    position: relative;
    margin: 20px auto;
}

.bucket {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(135, 206, 235, 0.2);
    border-top-color: #87ceeb;
    border-radius: 50%;
    animation: spinFast 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes spinFast {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Usage Stats */
.usage-stats {
    margin-top: 15px;
}

.usage-info {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 14px;
    color: black !important;
    backdrop-filter: blur(10px);
}

.usage-info.success {
    background: rgba(46, 204, 113, 0.3);
}

.usage-info.warning {
    background: rgba(241, 196, 15, 0.3);
}

.usage-info.danger {
    background: rgba(231, 76, 60, 0.3);
}

/* Image Buttons */
.image-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Legacy button styles - kept for compatibility */
.download-btn {
    padding: 10px 20px;
    background: var(--rapidviz-button, #28a745);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.download-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    text-decoration: none;
    color: white;
}

/* Debug Box */
.rapidviz-debug-box {
    padding: 15px;
    background: rgba(102, 126, 234, 0.05);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    margin: 15px 0;
    font-size: 13px;
    color: #333;
}

.rapidviz-debug-box strong {
    color: #2c3e50;
    font-weight: 600;
}

.rapidviz-debug-box #imageSourceText {
    color: #34495e;
    font-style: italic;
}

.rapidviz-debug-box #imageSourceUrl {
    color: #666;
    font-size: 11px;
}

.rapidviz-debug-box #finalPromptText {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    padding: 10px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #2c3e50;
    max-height: 300px;
    overflow-y: auto;
}

.rapidviz-debug-box #apiResponseText {
    background: #f0f4ff;
    border: 1px solid #c8d4f0;
    padding: 10px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    color: #2c3e50;
}

.rapidviz-debug-box #currentModelText {
    color: #667eea;
    font-weight: 600;
}

/* Save button for Style and Secret Sauce */
.rapidviz-save-btn {
    padding: 6px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.rapidviz-save-btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.rapidviz-save-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* Storage paragraph styling 
 * These paragraphs are HIDDEN on the frontend but VISIBLE in WordPress backend editor
 * This allows direct editing in the page editor while keeping them hidden from visitors
 */

/* Hide storage paragraphs on frontend only (not in admin/editor) */
body:not(.wp-admin) .rapidviz-style-storage,
body:not(.wp-admin) .rapidviz-secret-sauce-storage,
body:not(.wp-admin) .rapidviz-camera-storage {
    display: none !important;
}

/* Styling for backend editor view */
.rapidviz-style-storage,
.rapidviz-secret-sauce-storage,
.rapidviz-camera-storage {
    margin-top: 15px;
    padding: 12px;
    background: #f0f4ff;
    border-left: 4px solid #667eea;
    border-radius: 4px;
    font-size: 14px;
    color: #2c3e50;
    white-space: pre-wrap;
    line-height: 1.6;
}

/* Custom Login Button - Modern Animated Style */
.rapidviz-login-container {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    margin: 30px 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.rapidviz-login-btn {
    display: inline-block;
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--rapidviz-primary, #667eea) 0%, var(--rapidviz-secondary, #764ba2) 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.5px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.rapidviz-login-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    color: white !important;
    text-decoration: none;
}

.rapidviz-login-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

/* Shine Effect */
.rapidviz-login-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    -webkit-transform: skewX(-25deg);
    transform: skewX(-25deg);
    -webkit-animation: shine 3s infinite;
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}
