/* Secondary upload area custom styles */
.secondary-upload-area {
    min-height: 110px;
    max-height: 140px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #f8f9fa 0%, #f0f0f0 100%);
    border: 2px dashed #3498db;
    border-radius: 10px;
    position: relative;
    margin: 0;
    box-shadow: 0 2px 8px rgba(44,62,80,0.06);
    transition: background 0.2s, border-color 0.2s;
}

.secondary-upload-area:hover {
    background: linear-gradient(45deg, #e8f4f8 0%, #e0f7fa 100%);
    border-color: #2980b9;
}

.secondary-upload-img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(44,62,80,0.12);
    display: block;
    margin: 0;
}

.secondary-upload-placeholder {
    width: 100%;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3498db;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    background: none;
    border-radius: 8px;
    margin: 0;
}
/* 
 * Image Diffusion App - Tuusulan Remontti Theme
 * Professional renovation company inspired design
 */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #2c3e50;
    line-height: 1.6;
}

/* Header with Logo */
.app-header {
    background: rgb(22,69,35);
    color: #fff;
    padding: 25px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    min-height: 140px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.header-content {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.app-logo {
    height: 110px;
    width: auto;
    object-fit: contain;
    border-radius: 5px;
    transition: transform 0.3s ease;
    position: absolute;
    left: 0;
}

.app-logo:hover {
    transform: scale(1.05);
}

.app-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-weight: 600;
    text-align: center;
}

.app-header h1 {
    font-size: 2.8rem;
    font-weight: 600;
    margin: 0;
    color: #fff;
    text-shadow: none;
}

.app-subtitle {
    font-size: 1.2rem;
    color: #fff;
    margin-top: 8px;
    font-weight: 400;
}

.app-header .subtitle {
    position: relative;
    z-index: 2;
    font-size: 1.1rem;
    color: #7f8c8d;
    font-weight: 400;
}

/* Main Container - Professional Layout */
.main-container {
    display: flex;
    min-height: calc(100vh - 120px);
    max-width: 1400px;
    margin: 0 auto;
    background: #ffffff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

/* Panel Layouts */
.left-panel {
    flex: 1;
    min-width: 280px;
    background: #ecf0f1;
    padding: 30px 20px;
    border-right: 2px solid #bdc3c7;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.center-panel {
    flex: 2;
    padding: 30px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.right-panel {
    flex: 1;
    min-width: 320px;
    background: #f8f9fa;
    padding: 30px 20px;
    border-left: 2px solid #bdc3c7;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Upload Area - Construction Theme */
.upload-area {
    border: 3px dashed #3498db;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(45deg, #f8f9fa 0%, #ffffff 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 48px;
    font-weight: bold;
    color: #3498db;
    position: relative;
    overflow: hidden;
}


.upload-area:hover {
    border-color: #2980b9;
    background: linear-gradient(45deg, #e8f4f8 0%, #f0f8ff 100%);
    color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.2);
}

/* Image Display */
.main-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    object-fit: contain;
}

.main-image:hover {
    transform: scale(1.02);
}

.thumbnail-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin: 5px;
    cursor: pointer;
    border: 3px solid #bdc3c7;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.thumbnail-image:hover {
    border-color: #3498db;
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* Professional Button Styles */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}


.btn-preset {
    background: linear-gradient(135deg, rgb(22,69,35) 0%, rgb(22,69,35) 100%);
    color: white;
    margin-bottom: 12px;
    box-shadow: 0 4px 15px rgba(22,69,35,0.3);
    width: 100%;
    box-sizing: border-box;
}

 .btn-preset:hover {
    background: linear-gradient(135deg, rgb(18,60,30) 0%, rgb(22,69,35) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(22,69,35,0.4);
}

.btn-generate {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    font-size: 18px;
    padding: 18px 32px;
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3);
}

.btn-generate:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
}

/* Text Input - Professional Style */
.text-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
    font-family: inherit;
}

.text-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background: #f8f9ff;
}

.text-input::placeholder {
    color: #7f8c8d;
    font-style: italic;
}

/* Container Sections */
.preset-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preset-buttons-container::before {
    content: '🔧 Remonttityökalut';
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgb(22,69,35);
    display: block;
}

.input-container {
    margin: 20px 0;
}

.input-container::before {
    content: '✏️ Oma Kehotus';
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
    display: block;
}

.generate-buttons-container::before {
    content: '🚀 Luo Kuva';
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
    display: block;
}

/* Gallery Section */
#output-image-upload {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px 0;
}

#output-image-upload::before {
    content: '🖼️ Kuvagalleria';
    width: 100%;
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
        margin: 10px;
        border-radius: 0;
    }
    
    .left-panel,
    .right-panel {
        min-width: auto;
        border: none;
        border-bottom: 2px solid #bdc3c7;
    }
    
    .center-panel {
        border: none;
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        text-align: center;
        padding: 25px 15px;
        min-height: 160px;
        position: relative;
    }
    
    .header-content {
        flex-direction: column;
        gap: 20px;
        position: static;
    }
    
    .app-logo {
        height: 80px;
        position: static;
        transform: none;
        align-self: center;
    }
    
    .app-title {
        position: static;
        transform: none;
        text-align: center;
    }
    
    .app-header h1 {
        font-size: 1.8rem;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .text-input {
        padding: 14px 16px;
        font-size: 14px;
    }
    
    .upload-area {
        padding: 40px 15px;
        font-size: 36px;
    }
    
    .left-panel,
    .right-panel,
    .center-panel {
        padding: 20px 15px;
    }
}

/* Loading and Animation States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.thumbnail-image.selected {
    border-color: #e67e22;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.3);
}

/* Loading Spinner */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(248, 249, 250, 0.95);
    border-radius: 12px;
    backdrop-filter: blur(5px);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #ecf0f1;
    border-top: 4px solid #e74c3c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-text {
    font-size: 18px;
    color: #2c3e50;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
}

.loading-subtext {
    font-size: 14px;
    color: #7f8c8d;
    text-align: center;
    font-style: italic;
}

/* Progress dots animation */
.loading-text {
    position: relative;
}

.loading-text::after {
    content: '';
    animation: dots 1.5s infinite;
    position: absolute;
    width: 30px;
    text-align: left;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Button loading state */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    transform: translate(-50%, -50%);
}

/* Fade in animation for loading */
@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.loading-container {
    animation: fadeIn 0.3s ease-out;
}



/* --- Preset Floating Menu Styles (was floor-menu) --- */
.preset-menu-container {
    position: relative;
    height: 0;
    z-index: 100;
}

.preset-menu-box {
    background: #fff;
    box-shadow: 0 4px 24px rgba(44,62,80,0.12);
    border: 2px solid rgb(22,69,35);
    border-radius: 10px;
    padding: 18px 16px;
    position: absolute;
    z-index: 100;
    top: 0;
    left: 50%;
    transform: translate(-50%, 10px);
    min-width: 220px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preset-menu-btn {
    margin: 4px 0;
    width: 100%;
    background: linear-gradient(135deg, #e6f4e8 0%, #e6f4e8 100%);
    color: rgb(22,69,35);
    border: 1.5px solid rgb(22,69,35);
    border-radius: 7px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(22,69,35,0.08);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    padding: 12px 0;
    cursor: pointer;
}
 .preset-menu-btn:hover, .preset-menu-btn:focus {
    background: linear-gradient(135deg, rgb(22,69,35) 0%, #e6f4e8 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(22,69,35,0.18);
    outline: none;
}

/* Accessibility Improvements */
.btn:focus,
.text-input:focus,
.upload-area:focus,
.floor-menu-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}
