.welcome-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--bs-dark);
    color: white;
    padding-top: 80px;
}

.welcome-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-subtitle {
    font-size: 1.5rem;
    opacity: 0.8;
    margin-bottom: 3rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
}

/* Reduced size state when in generation flow */
.flow-active .welcome-title {
    font-size: 2rem;
    margin-bottom: 0.2rem;
}

.flow-active .welcome-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.flow-active .welcome-container {
    padding-top: 100px;
    justify-content: flex-start;
}

.option-cards {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    transition: all 0.5s ease;
}

.option-card {
    width: 280px;
    height: 280px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: white;
    position: relative;
    overflow: hidden;
}

.option-card:hover {
    background-color: #C1FF72;
    transform: translateY(-10px);
    border-color: #C1FF72;
    box-shadow: 0 20px 40px rgba(193, 255, 114, 0.2);
}

.option-card:hover .card-icon,
.option-card:hover .card-text {
    opacity: 0.2;
    transform: scale(0.8);
}

.card-icon,
.card-text {
    transition: all 0.3s ease;
}

.card-description {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    font-size: 0.95rem;
    color: var(--bs-dark);
    font-weight: 500;
    line-height: 1.5;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    text-align: center;
}

.option-card:hover .card-description {
    opacity: 1;
}

.card-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.card-text {
    font-size: 1.25rem;
    font-weight: 700;
    transition: color 0.3s ease;
}

/* Hover Overlay Styles */
.card-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.option-card:hover .card-hover-overlay {
    opacity: 1;
}

.overlay-btn {
    background: var(--bs-primary);
    color: var(--bs-dark);
    border: none;
    padding: 10px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease;
}

.overlay-btn:hover {
    transform: scale(1.05);
}

.selection-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Modal Styling */
.asset-picker-modal .modal-content {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}

.asset-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.asset-picker-item {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.asset-picker-item:hover {
    border-color: var(--bs-primary);
    transform: scale(1.05);
}

.asset-picker-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Progress Bar Styling */
.progress-container {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

.progress {
    height: 8px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 4px !important;
    overflow: hidden;
}

.progress-bar {
    background-color: var(--bs-primary) !important;
    transition: width 0.3s ease;
}

/* DIY Flow Styling */
.diy-layout-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    /* 2:1 Ratio: Bigger prompt, smaller image */
    gap: 2rem;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    align-items: stretch;
    /* Stretch both columns to equal height */
    transition: all 0.5s ease;
}

@media (max-width: 992px) {
    .diy-layout-grid {
        grid-template-columns: 1fr;
        max-width: 800px;
    }
}

/* Force result card to fill its side of the grid in DIY mode */
#diy-result-area .option-card {
    width: 100% !important;
    height: 100% !important;
    min-height: 350px;
    /* Ensure a minimum presence */
}

.diy-flow-container {
    width: 100%;
    transition: all 0.5s ease;
}

.prompt-input-wrapper {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.prompt-label {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bs-primary);
    text-align: left;
}

.diy-textarea {
    width: 100%;
    flex-grow: 1;
    min-height: 200px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: white;
    padding: 1.5rem;
    font-size: 1.1rem;
    resize: none;
    outline: none;
    transition: all 0.3s ease;
}

.diy-textarea:focus {
    border-color: var(--bs-primary);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 20px rgba(193, 255, 114, 0.1);
}

/* Result Actions Overlay */
.asset-actions-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

.option-card:hover .asset-actions-overlay {
    opacity: 1;
}

.action-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-dark);
    font-size: 1.25rem;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action-btn:hover {
    transform: scale(1.1);
    background: var(--bs-primary);
    color: var(--bs-dark);
}

.action-btn.delete:hover {
    background: #FF4B4B;
    color: white;
}

/* Asset Viewer Modal */
.asset-viewer-modal .modal-content {
    background: rgba(15, 20, 22, 0.8) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
}

.asset-viewer-modal .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.viewer-image-container {
    width: 100%;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.viewer-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

/* Reference Flow Grid Styles */
.reference-layout-grid {
    display: grid;
    grid-template-columns: 280px 1.5fr 576px;
    gap: 2rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    align-items: stretch;
    transition: all 0.5s ease;
}

.sources-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sources-column .option-card {
    width: 100% !important;
    height: 280px !important;
}

.prompt-column {
    height: 100%;
}

.result-column {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.result-column .option-card {
    width: 100% !important;
    max-width: 576px;
    height: auto !important;
    aspect-ratio: 1 / 1;
    min-height: 280px;
}

/* Tablet & Mobile Responsiveness */
@media (max-width: 1200px) {
    .reference-layout-grid {
        grid-template-columns: 280px 1fr;
        max-width: 1000px;
    }

    .result-column {
        grid-column: span 2;
        margin-top: 1rem;
    }

    .result-column .option-card {
        max-width: 500px;
    }
}

@media (max-width: 991px) {
    .reference-layout-grid {
        grid-template-columns: 1fr;
        max-width: 600px;
        gap: 1.5rem;
    }

    .sources-column {
        flex-direction: row;
        gap: 1rem;
    }

    .sources-column .option-card {
        flex: 1;
        height: 240px !important;
    }

    .result-column {
        grid-column: span 1;
    }
}

@media (max-width: 576px) {
    .sources-column {
        flex-direction: column;
    }

    .sources-column .option-card {
        height: 280px !important;
    }

    .reference-layout-grid {
        padding: 0 10px;
    }

    #generation-actions {
        flex-direction: column-reverse;
        /* Stack buttons with Generate on top */
        gap: 1rem;
    }

    #generation-actions .btn {
        width: 100% !important;
        margin: 0 !important;
    }

    /* Global Mobile Spacing Fix */
    .welcome-section,
    .generate-images-section,
    .assets-container {
        padding-bottom: 4rem !important;
        /* Adjusted space at end of all dashboard pages */
    }
}

.diy-textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.prompt-hint {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}