/* QuarkCode Core Styles
.quarkcode-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--quarkcode-primary, #667eea) 0%, var(--quarkcode-secondary, #764ba2) 100%);
    color: var(--quarkcode-text, #333);
}

/* Updated container styles for full width support */
.quarkcode-container {
    max-width: 100%; /* Changed from 800px to 100% */
    width: 100%;     /* Added full width */
    margin: 0 auto;  /* Changed from 20px auto to 0 auto */
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--quarkcode-primary, #667eea) 0%, var(--quarkcode-secondary, #764ba2) 100%);
    color: var(--quarkcode-text, #333);
    box-sizing: border-box;
}

/* Rest of your existing CSS... */

.quarkcode-header {
    text-align: center;
    margin-bottom: 30px;
}

.quarkcode-header h3 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
    color: white;
}

.quarkcode-header p {
    margin: 0 0 15px 0;
    opacity: 0.9;
    color: white;
}

.quarkcode-form {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.quarkcode-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.quarkcode-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.quarkcode-form textarea:focus {
    outline: none;
    border-color: var(--quarkcode-primary, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.quarkcode-form input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px dashed #e1e5e9;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quarkcode-form input[type="file"]:hover {
    border-color: var(--quarkcode-primary, #667eea);
    background: #f0f4ff;
}

.input-group {
    margin-bottom: 20px;
}

.image-preview-container img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 15px;
}

.continue-editing-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--quarkcode-primary, #667eea);
}

.current-edit-image img {
    max-width: 200px;
    border-radius: 8px;
    margin: 10px 0;
}

.secondary-btn {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 10px;
    transition: background 0.3s ease;
}

.secondary-btn:hover {
    background: #5a6268;
}

.quarkcode-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #dc3545;
}

.results {
    margin-top: 20px;
}

.generated-image-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.generated-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.generated-image:hover {
    transform: scale(1.02);
}

.ai-response {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.ai-response p {
    margin: 0;
    line-height: 1.6;
}

/* Fixed action container */
.quarkcode-action {
    margin-top: 20px;
    text-align: center;
}

.generate-button {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--quarkcode-primary, #667eea) 0%, var(--quarkcode-secondary, #764ba2) 100%);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block; /* ✅ Ensure button is always visible */
}

.generate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.generate-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Enhanced image interaction styles */
.generated-image,
.gallery-image {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.generated-image:hover,
.gallery-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Fullscreen styles */
.generated-image:fullscreen,
.gallery-image:fullscreen {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    background: black;
}

/* Webkit fullscreen support */
.generated-image:-webkit-full-screen,
.gallery-image:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    background: black;
}

/* Mozilla fullscreen support */
.generated-image:-moz-full-screen,
.gallery-image:-moz-full-screen {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    background: black;
}

/* Add loading cursor when entering fullscreen */
.entering-fullscreen {
    cursor: wait !important;
}

/* Image Popup Modal Styles */
.quarkcode-popup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: pointer;
    animation: fadeIn 0.3s ease-out;
}

.quarkcode-popup-image {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
    cursor: default;
    animation: zoomIn 0.3s ease-out;
}

.quarkcode-popup-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10000;
}

.quarkcode-popup-close:hover {
    color: #ccc;
}

/* Image hover effects */
.generated-image,
.gallery-image {
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.generated-image:hover,
.gallery-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .quarkcode-popup-image {
        max-width: 95%;
        max-height: 85%;
    }
    
    .quarkcode-popup-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }
}
