/* --- Global Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #0e1217;
    min-height: 100vh;
    padding: 0;
    overflow-x: hidden;
}

/* --- Main Layout Wrapper --- */
.main-layout-wrapper {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
    width: 100%;
    margin: 0;
    padding: 0.5rem 1.5rem 4rem 1.5rem;
    padding-bottom: 4rem;
    min-height: 100vh;
    box-sizing: border-box;
}

label {
    color: #cc78c9;
}

/* --- Left Column --- */
.left-controls-column {
    flex: 0 0 420px;
    background: #1a1f28;
    padding: 32px 24px;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    border-radius: 12px;
    border: 1px solid rgba(100, 116, 139, 0.3);
    overflow-y: auto;
    max-height: calc(100vh - 4rem);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* --- Dropdown Row --- */
.dropdown-row {
    display: flex;
    gap: 15px;
    margin-bottom: 0;
}

/* --- Dropdown Box styles --- */
.dropdown-box {
    flex: 1;
    position: relative;
}

.dropdown-box select {
    width: 100%;
    padding: 12px 15px;
    background-color: #28303a;
    border: 1.5px solid rgba(134, 38, 130, 0.3);
    border-radius: 10px;
    color: #f3f4f6;
    font-family: "Montserrat", sans-serif;
    font-size: 0.95rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    background-image: url("data:image/svg+xml,%3Csvg fill='%23f3f4f6' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
    padding-right: 40px;
}

.dropdown-box select:hover {
    background-color: #313a45;
    border-color: rgba(134, 38, 130, 0.5);
}

.dropdown-box select:focus {
    border-color: #862682;
    box-shadow: 0 0 0 3px rgba(134, 38, 130, 0.3);
}

.dropdown-box select option {
    background-color: #313a45;
    color: #f3f4f6;
    padding: 10px;
}

/* --- Prompt Box --- */
.prompt-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prompt-box textarea {
    width: 100%;
    min-height: 110px;
    background: #2d3748;
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 8px;
    color: #f3f4f6;
    font-size: 0.95rem;
    padding: 12px;
    resize: none;
    outline: none;
    transition: 0.3s;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.prompt-box textarea:focus {
    border-color: rgba(148, 163, 184, 0.6);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25);
}

.prompt-box textarea::placeholder {
    color: #6b7280;
}

.prompt-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

/* --- Buttons --- */
.enhance-btn {
    background: linear-gradient(135deg, #9b297a, #752161);
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(134, 38, 130, 0.3);
    transition: all 0.3s ease;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.enhance-btn:hover {
    background: linear-gradient(135deg, #752161, #54194d);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25);;
}

.enhance-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.delete-btn {
    background-color: #313a45;
    border: 1px solid rgba(255, 99, 71, 0.4);
    color: #ff6347;
    padding: 10px;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-btn:hover {
    background-color: #ff6347;
    color: white;
}

/* --- Control Section --- */
.control-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* --- Generate & Gallery Buttons --- */
.button-group-img {
    display: flex;
    gap: 10px;
}

.generate-btn,
.gallery-btn {
    flex: 1;
    padding: 12px 16px; /* Consistent padding */
    font-weight: 600;
    font-size: 0.95rem; /* Consistent font size */
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    border: none;
}

.generate-btn {
    background: linear-gradient(135deg, #9b297a, #752161);
    color: #ffffff;
    /* Remove the extra padding and font-size from here */
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(134, 38, 130, 0.4);
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    /* Remove: padding: 12px 20px; */
    /* Remove: font-size: 1rem; */
}

.generate-btn:hover {
    background: linear-gradient(135deg, #752161, #54194d);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.gallery-btn {
    background-color: #2d3748;
    color: #f3f4f6;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.gallery-btn:hover {
    background-color: #38424d;
    border-color: rgba(148, 163, 184, 0.6);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25);
}

.checkbox-section {
    margin-top: 10px;
    text-align: center;
    background: linear-gradient(90deg, #ff6fd8, #3813c2); /* choose any gradient */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 0.85rem;
    font-weight: 500;
}

.checkbox-section input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    accent-color: #862682;
}

/* --- Loader --- */
/* Enhanced Loader Styles */
.loader {
    width: 100%;
    margin-top: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    animation: fadeIn 0.3s ease-in;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loader p {
    color: white;
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    text-align: center;
}

/* Animated Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Generate Button Loading State - Only spinner circle */
.generate-btn {
    position: relative;
    overflow: hidden;
}

.generate-btn.loading {
    pointer-events: none;
    color: transparent;
}

/* Spinner circle only inside button */
.generate-btn.loading::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: buttonSpin 0.8s linear infinite;
}

@keyframes buttonSpin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Ensure disabled state maintains button appearance */
.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* Optional: Disable button while generating */
.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Optional: Disable button while generating */
.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- Preview Column Wrapper --- */
.preview-column-wrapper {
    flex: 1;
    background: #1a1f28;
    padding: 32px;
    border-radius: 12px;
    border: 1px solid rgba(100, 116, 139, 0.3);
    overflow-y: auto;
    max-height: calc(100vh - 4rem);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* --- Main Preview Container (Contains everything) --- */
.preview-container {
    background-color: #1e242c;
    border: 1px solid rgba(134, 38, 130, 0.15);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* --- Preview Title --- */
.preview-title {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 25px;
    text-align: center;
    font-family: "Montserrat", sans-serif;
}

/* --- Preview Area (Where generated image appears) --- */
.preview-area {
    background-color: #0e1217;
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 12px;
    color: #6b7280;
    font-size: 1rem;
    padding: 60px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    margin-bottom: 30px;
}

.preview-area:empty::after {
    content: "Your generated vector image will appear here";
    color: #6c757d;
    opacity: 0.75; /* muted effect */
    font-size: 1rem;
    font-weight: 400; /* optional */
}
/* When image is loaded */
.preview-area:has(.generated-image-wrapper img) {
    min-height: auto;
    padding: 30px;
}

/* --- Generated Image Wrapper --- */
.generated-image-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.generated-image-wrapper img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.generated-image-wrapper p {
    color: #9ca3af;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

/* --- Previously Generated Section --- */
.previously-generated-section {
    margin-top: 30px;
    padding-top: 30px;
}

/* --- Sub Header for Previous Images --- */
.sub-header {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    font-family: "Montserrat", sans-serif;
    margin-bottom: 25px;
    text-align: center;
}

/* --- Previous Images Grid --- */
.previous-images-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.previous-images-grid .card {
    background-color: #1e242c;
    border: 1px solid rgba(134, 38, 130, 0.15);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.previous-images-grid .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(134, 38, 130, 0.4);
    border-color: rgba(134, 38, 130, 0.5);
}

.previous-images-grid .card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.previous-images-grid .card:hover img {
    transform: scale(1.05);
}

.previous-images-grid .card-body {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
}

.previous-images-grid .card-body small {
    color: #9ca3af;
    font-size: 12px;
    line-height: 1.4;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Download Button --- */
.btn-primary {
    background: linear-gradient(135deg, #862682 0%, #c73ec0 100%);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    color: #ffffff;
    transition: all 0.3s ease;
    font-size: 14px;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(134, 38, 130, 0.5);
    background: linear-gradient(135deg, #9d2d99 0%, #d956cf 100%);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* --- Loading State --- */
.preview-area.loading {
    background: linear-gradient(90deg, #1e242c 25%, #252c36 50%, #1e242c 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Hide scrollbar completely */
.preview-column-wrapper,
.left-controls-column {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.preview-column-wrapper::-webkit-scrollbar,
.left-controls-column::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* --- Responsive Design --- */
@media (max-width: 1200px) {
    .main-layout-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .left-controls-column {
        max-width: 100%;
    }

    .previous-images-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 1024px) {
    .main-layout-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }

    .left-controls-column {
        height: auto;
        max-height: none;
    }

    .preview-area {
        min-height: 350px;
    }
}

@media (max-width: 768px) {
    .dropdown-row {
        flex-direction: column;
    }

    .prompt-actions {
        flex-direction: column;
    }

    .enhance-btn {
        width: 100%;
    }

    .button-group-img {
        flex-direction: column;
    }

    .preview-container {
        padding: 20px;
    }

    .preview-area {
        min-height: 300px;
        padding: 40px 20px;
        font-size: 0.95rem;
    }

    .previous-images-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .previous-images-grid .card img {
        height: 150px;
    }

    .preview-title {
        font-size: 24px;
    }

    .sub-header {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .main-layout-wrapper {
        padding: 0 10px;
    }

    .left-controls-column {
        padding: 20px 16px;
    }

    .preview-container {
        padding: 15px;
    }

    .previous-images-grid {
        grid-template-columns: 1fr;
    }

    .preview-area {
        min-height: 250px;
        padding: 30px 15px;
        font-size: 0.9rem;
    }

    .preview-title {
        font-size: 22px;
    }

    .sub-header {
        font-size: 16px;
    }
}

.dropdown-label {
    font-size: 0.875rem;
    color: #e5e7eb;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

    /* Enhanced Model Selector Styles */
    .model-selector-wrapper {
        position: relative;
        font-family: 'Montserrat', sans-serif;
    }

    .custom-model-dropdown {
        position: relative;
        width: 100%;
    }

    .model-dropdown-trigger {
        background: #2d3748;
        border: 2px solid rgba(100, 116, 139, 0.3);
        border-radius: 12px;
        padding: 16px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
        transition: all 0.3s ease;
    }

    .model-dropdown-trigger:hover {
        border-color: rgba(148, 163, 184, 0.6);
        box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25);
        background: #374151;
    }
    

    .selected-model-display {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .model-icon {
        width: 40px;
        height: 40px;
        background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 18px;
        overflow: hidden;
    }

    .model-icon img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .model-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .model-name {
        font-weight: 600;
        font-size: 15px;
        color: #ffffff;
    }

    .model-description {
        font-size: 12px;
        color: #a0a0b0;
    }

    .dropdown-arrow {
        color: white;
        transition: transform 0.3s ease;
        font-size: 14px;
    }

    .custom-model-dropdown.active .dropdown-arrow {
        transform: rotate(180deg);
    }

    .model-dropdown-menu {
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: 0;
        background: #2d3748;
        border: 2px solid rgba(100, 116, 139, 0.3);
        border-radius: 12px;
        padding: 8px;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        z-index: 1000;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    }

    .custom-model-dropdown.active .model-dropdown-menu {
        max-height: 400px;
        opacity: 1;
        transform: translateY(0);
    }

    .model-option {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.2s ease;
        margin-bottom: 4px;
    }

    .model-option:hover {
        background: #374151;
    }

    .model-option.selected {
        background: #374151;
    }

    .model-option-radio {
        width: 20px;
        height: 20px;
        border: 2px solid rgba(148, 163, 184, 0.6);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .radio-dot {
        width: 10px;
        height: 10px;
        background: rgba(148, 163, 184, 0.6);
        border-radius: 50%;
        opacity: 0;
        transform: scale(0);
        transition: all 0.2s ease;
    }

    .model-option.selected .radio-dot {
        opacity: 1;
        transform: scale(1);
    }

    .model-option .model-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .model-option .model-name {
        font-size: 14px;
    }

    .model-option .model-description {
        font-size: 11px;
    }

    /* Navigation arrows */
    .nav-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.5);
        color: #fff;
        border: none;
        font-size: 2rem;
        padding: 0.4em 0.6em;
        border-radius: 50%;
        cursor: pointer;
        z-index: 5;
        transition: 0.2s;
    }

    .nav-arrow:hover {
        background: rgba(255, 255, 255, 0.25);
    }

    #prevBtn {
        left: 10px;
    }

    #nextBtn {
        right: 10px;
    }

.ratio-selector-wrapper {
    font-family: 'Montserrat', sans-serif;
}

.ratio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 12px;
}

/* The card */
.ratio-selector-wrapper {
    font-family: 'Montserrat', sans-serif;
}

.ratio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 12px;
}

.ratio-card {
    background: #2d3748;
    border: 2px solid rgba(100, 116, 139, 0.3);
    border-radius: 10px;
    padding: 12px;
    height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: 0.3s;
}

.ratio-card:hover {
    border-color: rgba(148, 163, 184, 0.6);
    background: #374151;
}

.ratio-card.active {
    border-color: #94a3b8;
}

/* ✅ TRUE RATIO VISUALS */
.ratio-visual {
    width: 38px;        /* fixed width */
    height: auto;       /* auto height */
    background: linear-gradient(135deg, #6b7280, #e5e7eb);
    border-radius: 6px;
}

/* ✅ LABEL ALWAYS AT BOTTOM */
.ratio-label {
    margin-top: auto;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
}

.ratio-card.active .ratio-label {
    color: #94a3b8;
}

/* Mobile Responsive Styles for Vector Generator */
@media (max-width: 768px) {
    .main-layout-wrapper {
        flex-direction: column;
        padding: 0.5rem 1rem 2rem 1rem;
        gap: 1rem;
    }

    .left-controls-column,
    .preview-column-wrapper {
        flex: none;
        width: 100%;
    }

    .left-controls-column {
        max-height: none;
        padding: 1.5rem;
        border-radius: 12px;
    }

    .preview-column-wrapper {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .preview-area {
        min-height: 300px;
        margin: 0 auto;
    }

    .preview-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    /* Model selector adjustments */
    .model-selector-wrapper {
        margin-bottom: 1rem;
    }

    /* Adjust ratio grid for mobile */
    .ratio-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .ratio-card {
        height: 100px;
        padding: 8px;
    }

    .ratio-visual {
        width: 30px;
    }

    .ratio-label {
        font-size: 11px;
    }

    /* Previous images grid */
    .previous-images-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0;
    }

    .sub-header {
        font-size: 1.1rem;
        margin-top: 2rem;
        margin-bottom: 1rem;
    }

    /* Toast positioning for mobile */
    .toast-container {
        padding: 1rem;
    }

    .toast {
        width: 100%;
        max-width: none;
        margin-bottom: 1rem;
    }

    /* Modal adjustments for mobile */
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }

    .nav-arrow {
        font-size: 1.5rem;
        padding: 0.3em 0.5em;
    }

    #prevBtn {
        left: 5px;
    }

    #nextBtn {
        right: 5px;
    }
}

@media (max-width: 480px) {
    .main-layout-wrapper {
        padding: 0.5rem 0.75rem 2rem 0.75rem;
    }

    .left-controls-column,
    .preview-column-wrapper {
        padding: 1rem;
    }

    .ratio-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .ratio-card {
        height: 90px;
    }

    .previous-images-grid {
        grid-template-columns: 1fr;
    }

    .model-dropdown-trigger {
        padding: 10px 12px;
    }

    .model-icon {
        width: 32px;
        height: 32px;
    }

    .model-name {
        font-size: 0.9rem;
    }

    .model-description {
        font-size: 0.75rem;
    }

    .prompt-box textarea {
        min-height: 80px;
        font-size: 0.85rem;
    }

    .checkbox-section {
        font-size: 0.8rem;
    }
}

/* Additional mobile-specific improvements */
@media (max-width: 768px) {
    /* Ensure proper centering */
    .preview-column-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .preview-area {
        width: 100%;
        max-width: 400px;
    }

    /* Better spacing for mobile */
    .model-selector-wrapper.mb-3 {
        margin-bottom: 1.5rem !important;
    }

    .ratio-selector-wrapper.mb-1 {
        margin-bottom: 1.5rem !important;
    }

    .prompt-box {
        margin-bottom: 1.5rem !important;
    }
}

/* Landscape mode adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .main-layout-wrapper {
        flex-direction: row;
        min-height: auto;
    }

    .left-controls-column {
        flex: 0 0 45%;
    }

    .preview-column-wrapper {
        flex: 1;
    }

    .left-controls-column,
    .preview-column-wrapper {
        max-height: 80vh;
    }

    .preview-area {
        min-height: 200px;
    }
}

/* Prevent horizontal scrolling */
body {
    overflow-x: hidden;
}

.main-layout-wrapper {
    max-width: 100%;
    overflow-x: hidden;
}

/* --- Mobile Button Fix --- */
@media (max-width: 768px) {
    .button-group-img {
        flex-direction: row; /* Keep buttons side by side */
        gap: 10px;
    }

    /* Fix for prompt actions buttons */
    .prompt-actions {
        flex-direction: row; /* Keep these side by side on mobile */
        gap: 10px;
    }

    .enhance-btn {
        flex: 2; /* Give more space to enhance button */
    }

    .delete-btn {
        flex: 0 0 48px; /* Fixed size for delete button */
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 480px) {
    .button-group-img {
        gap: 10px;
    }

    .generate-btn,
    .gallery-btn,
    .enhance-btn {
        min-height: 44px;
        font-size: 0.95rem;
        padding: 12px 14px;
    }

    .prompt-actions {
        gap: 8px;
    }

    .enhance-btn {
        flex: 2;
    }

    .delete-btn {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
    }
}

/* Additional fix for loading states on mobile */
@media (max-width: 768px) {
    .generate-btn.loading::before {
        width: 20px;
        height: 20px;
        border-width: 2px;
    }
}
