/* QuarkCode Core Styles */

/* Updated container styles for full width support */
.quarkcode-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    -webkit-box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    -moz-box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5 !important;
    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);
}

#editMode {
    margin-bottom: 0;
}

.quarkcode-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

#editPromptLabel {
    display: none !important;
}

.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;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-transition: border-color 0.3s ease, box-shadow 0.3s ease;
    -o-transition: border-color 0.3s ease, box-shadow 0.3s ease;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    -webkit-box-shadow: rgba(0, 0, 0, 0.1) 0px 8px 24px;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 8px 24px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.quarkcode-form textarea:focus {
    outline: none !important;
    outline-width: 0 !important;
    outline-color: transparent !important;
    -webkit-outline: none !important;
    border-color: rgba(128, 128, 128, 0.1);
    -webkit-box-shadow: rgba(0, 0, 0, 0.1) 0px 8px 24px;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 8px 24px;
}

#editPrompt:focus,
#prompt:focus {
    outline: none !important;
    outline-width: 0 !important;
    outline-color: transparent !important;
    border-color: rgba(128, 128, 128, 0.1) !important;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 8px 24px !important;
}

/* Make editPrompt placeholder barely visible */
#editPrompt::-webkit-input-placeholder {
    opacity: 0.3;
}

#editPrompt::-moz-placeholder {
    opacity: 0.3;
}

#editPrompt:-ms-input-placeholder {
    opacity: 0.3;
}

#editPrompt::placeholder {
    opacity: 0.3;
}

.character-counter {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    margin-bottom: 10px;
    max-width: 100%;
}

.character-counter > * {
    margin-bottom: 4px;
}

.character-counter > *:last-child {
    margin-bottom: 0;
}

/* Modern browsers with gap support */
@supports (gap: 4px) {
    .character-counter {
        gap: 4px;
    }
    
    .character-counter > * {
        margin-bottom: 0;
    }
}

/* Counter lines - two rows */
.counter-line {
    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;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-flex-wrap: nowrap;
    -ms-flex-wrap: nowrap;
    flex-wrap: nowrap;
    width: 100%;
}

/* Cross-browser spacing support */
.counter-line > * {
    margin: 0 5px;
}

.counter-line > *:first-child {
    margin-left: 0;
}

.counter-line > *:last-child {
    margin-right: 0;
}

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

.counter-line-top {
    /* Inherits center from .counter-line */
}

.counter-line-bottom {
    /* Inherits center from .counter-line */
}

/* Image ratio group - keeps ratio label and dropdown together */
.image-ratio-group {
    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;
    -webkit-flex-wrap: nowrap;
    -ms-flex-wrap: nowrap;
    flex-wrap: nowrap;
    -webkit-flex-shrink: 0;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.image-ratio-group > * {
    margin-right: 4px;
}

.image-ratio-group > *:last-child {
    margin-right: 0;
}

/* Modern browsers with gap support */
@supports (gap: 4px) {
    .image-ratio-group {
        gap: 4px;
    }
    
    .image-ratio-group > * {
        margin-right: 0;
    }
}

.counter-text {
    white-space: nowrap;
    -webkit-flex-shrink: 0;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.character-count-display {
    white-space: nowrap;
    -webkit-flex-shrink: 0;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.character-counter span {
    font-weight: 600;
}

/* Prompt addon controls (Camera, Style & Secret inline controls) */
.prompt-addon-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;
    -webkit-flex-wrap: nowrap;
    -ms-flex-wrap: nowrap;
    flex-wrap: nowrap;
    -webkit-flex-shrink: 0;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.prompt-addon-controls > * {
    margin-right: 3px;
}

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

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

.prompt-addon-checkbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin: 0;
    -webkit-appearance: checkbox;
    -moz-appearance: checkbox;
    appearance: checkbox;
}

.prompt-addon-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin: 0;
    margin-left: 3px;
    white-space: nowrap;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.prompt-addon-label-clickable {
    cursor: pointer;
    -webkit-transition: color 0.2s ease, text-decoration 0.2s ease;
    -o-transition: color 0.2s ease, text-decoration 0.2s ease;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.prompt-addon-label-clickable:hover {
    color: #667eea;
    text-decoration: underline;
}

.prompt-addon-label-clickable:active {
    color: #5568d3;
}

/* Inline usage display */
.inline-usage-info {
    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;
    -webkit-flex-wrap: nowrap;
    -ms-flex-wrap: nowrap;
    flex-wrap: nowrap;
    -webkit-flex-shrink: 0;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.inline-usage-info > * {
    margin-right: 4px;
}

.inline-usage-info > *:last-child {
    margin-right: 0;
}

/* Modern browsers with gap support */
@supports (gap: 4px) {
    .inline-usage-info {
        gap: 4px;
    }
    
    .inline-usage-info > * {
        margin-right: 0;
    }
}

.inline-usage-info .usage-label {
    white-space: nowrap;
    font-weight: 400;
}

.inline-usage-info .usage-value {
    white-space: nowrap;
}

/* Red color when tokens are 0 */
.inline-usage-info.tokens-zero .usage-label,
.inline-usage-info.tokens-zero .usage-value {
    color: #dc3545;
}

/* Inline editor styles */
.quarkcode-inline-editor {
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    -webkit-box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.inline-editor-header {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    margin-bottom: 10px;
}

.inline-editor-header strong {
    color: #667eea;
    font-size: 14px;
}

.inline-editor-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    transition: color 0.2s ease;
    padding: 0;
    width: 24px;
    height: 24px;
}

.inline-editor-close:hover {
    color: #667eea;
}

.inline-editor-textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-transition: border-color 0.3s ease, box-shadow 0.3s ease;
    -o-transition: border-color 0.3s ease, box-shadow 0.3s ease;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    -webkit-box-shadow: rgba(0, 0, 0, 0.1) 0px 8px 24px;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 8px 24px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.inline-editor-textarea:focus {
    outline: none !important;
    outline-width: 0 !important;
    outline-color: transparent !important;
    -webkit-outline: none !important;
    border-color: rgba(128, 128, 128, 0.1);
    -webkit-box-shadow: rgba(0, 0, 0, 0.1) 0px 8px 24px;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 8px 24px;
}

.inline-editor-actions {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    margin-top: 10px;
}

.inline-editor-actions > * {
    margin-right: 10px;
}

.inline-editor-actions > *:last-child {
    margin-right: 0;
}

.inline-editor-save-btn {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.inline-editor-save-btn:hover {
    background: #5568d3;
    -webkit-transform: translateY(-1px);
    -ms-transform: translateY(-1px);
    transform: translateY(-1px);
}

.inline-editor-save-btn:active {
    -webkit-transform: translateY(0);
    -ms-transform: translateY(0);
    transform: translateY(0);
}

.inline-editor-cancel-btn {
    padding: 8px 16px;
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.inline-editor-cancel-btn:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.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 {
    display: none !important;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--quarkcode-primary, #667eea);
}

.current-edit-image {
    display: none !important;
}

.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: 10px;
    text-align: center;
    backdrop-filter: blur(10px);
}

/* Buttons container directly under generated image */
.quarkcode-buttons-container {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: stretch;
    -webkit-align-items: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    width: 100%;
    margin-bottom: 20px;
}

/* Cross-browser gap support */
.quarkcode-buttons-container > * {
    margin: 5px;
}

/* Modern browsers with gap support */
@supports (gap: 10px) {
    .quarkcode-buttons-container {
        gap: 10px;
    }
    
    .quarkcode-buttons-container > * {
        margin: 0;
    }
}

.generated-image-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    overflow: hidden;
    -webkit-transition: -webkit-transform 0.3s ease, -webkit-box-shadow 0.3s ease;
    transition: -webkit-transform 0.3s ease, -webkit-box-shadow 0.3s ease;
    -o-transition: transform 0.3s ease, box-shadow 0.3s ease;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transition: transform 0.3s ease, box-shadow 0.3s ease, -webkit-transform 0.3s ease, -webkit-box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.generated-image-wrapper:hover {
    -webkit-transform: translateY(-5px);
    -ms-transform: translateY(-5px);
    transform: translateY(-5px);
    -webkit-box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.generated-image {
    max-width: 100%;
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    -webkit-transition: -webkit-transform 0.3s ease;
    transition: -webkit-transform 0.3s ease;
    -o-transition: transform 0.3s ease;
    transition: transform 0.3s ease;
    transition: transform 0.3s ease, -webkit-transform 0.3s ease;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.generated-image:hover {
    -webkit-transform: scale(1.05);
    -ms-transform: scale(1.05);
    transform: scale(1.05);
}

.generated-image:active {
    cursor: -webkit-grabbing;
    cursor: grabbing;
}

/* Generated image overlay - hidden by default, shown on hover like gallery */
.generated-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: -webkit-gradient(linear, left top, left bottom, from(transparent), to(rgba(0, 0, 0, 0.8)));
    background: -o-linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 15px;
    -webkit-transform: translateY(100%);
    -ms-transform: translateY(100%);
    transform: translateY(100%);
    -webkit-transition: -webkit-transform 0.3s ease;
    transition: -webkit-transform 0.3s ease;
    -o-transition: transform 0.3s ease;
    transition: transform 0.3s ease;
    transition: transform 0.3s ease, -webkit-transform 0.3s ease;
}

.generated-image-wrapper:hover .generated-image-overlay {
    -webkit-transform: translateY(0);
    -ms-transform: translateY(0);
    transform: translateY(0);
}

.generated-download-btn {
    padding: 6px 12px;
    background: var(--quarkcode-button, #28a745);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    -webkit-transition: background 0.3s ease;
    -o-transition: background 0.3s ease;
    transition: background 0.3s ease;
    display: inline-block;
}

.generated-download-btn:hover {
    background: #218838;
    text-decoration: none;
    color: white;
}

.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 {
    text-align: center;
}

.quarkcode-action .character-counter {
    margin-top: 10px;
    justify-content: center;
}

.action-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.aspect-ratio-select {
    /* Reset browser defaults */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    /* Custom styling - matching counter style */
    padding: 0 18px 0 0;
    border: none;
    border-radius: 0;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    background-color: transparent;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"%3E%3Cpath fill="%23666" d="M6 9L1 4h10z"/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 10px;
    cursor: pointer;
    transition: color 0.3s ease;
    min-width: auto;
    box-shadow: none;
    line-height: 1.2;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Remove IE10+ default arrow */
.aspect-ratio-select::-ms-expand {
    display: none;
}

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

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

.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: 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;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    white-space: nowrap;
}

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

.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-link {
    display: block;
    max-width: 90%;
    max-height: 90%;
    text-decoration: none;
    cursor: default;
}

.quarkcode-popup-image {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
    cursor: -webkit-grab;
    cursor: grab;
    display: block;
    animation: zoomIn 0.3s ease-out;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.quarkcode-popup-image:active {
    cursor: -webkit-grabbing;
    cursor: grabbing;
}

.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;
}

.quarkcode-popup-download {
    position: absolute;
    top: 20px;
    right: 80px;
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    background: rgba(40, 167, 69, 0.8);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    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;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    z-index: 10000;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.quarkcode-popup-download:hover {
    background: rgba(40, 167, 69, 1);
    -webkit-transform: scale(1.1);
    -ms-transform: scale(1.1);
    transform: scale(1.1);
    color: white;
}

/* 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; }
}

/* External Image Loader Styles */
.quarkcode-external-image {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.quarkcode-external-image h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.external-image-container {
    text-align: center;
}

#externalImageDisplay {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}

#externalImageDisplay:hover {
    transform: scale(1.02);
}

.external-image-actions {
    margin-top: 15px;
    text-align: center;
}

.edit-external-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--quarkcode-primary, #667eea) 0%, var(--quarkcode-secondary, #764ba2) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-external-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .quarkcode-popup-image-link {
        max-width: 95%;
        max-height: 85%;
    }
    
    .quarkcode-popup-image {
        max-width: 100%;
        max-height: 80vh;
    }
    
    .quarkcode-popup-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }
    
    .quarkcode-popup-download {
        top: 10px;
        right: 60px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}
