/**
 * フロントエンド用スタイル
 * 
 * @package RealEstateImageConverter
 * @since 1.0.0
 */

/* 基本スタイル */
.reic-converter-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* アップロードセクション */
.reic-upload-section {
    margin-bottom: 30px;
}

.reic-upload-area {
    border: 3px dashed #007cba;
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.reic-upload-area:hover {
    border-color: #005a87;
    background: linear-gradient(135deg, #e6f3ff 0%, #d1e7ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 124, 186, 0.2);
}

.reic-upload-area.dragover {
    border-color: #005a87;
    background: linear-gradient(135deg, #d1e7ff 0%, #b8daff 100%);
    transform: scale(1.02);
}

.reic-upload-icon {
    margin-bottom: 20px;
    color: #007cba;
}

.reic-upload-content h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.reic-upload-content p {
    margin: 0 0 25px 0;
    color: #666;
    font-size: 16px;
}

.reic-upload-button {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
}

.reic-upload-button:hover {
    background: linear-gradient(135deg, #005a87 0%, #004066 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.4);
}

/* プレビューセクション */
.reic-preview-section {
    margin-top: 25px;
    padding: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.reic-preview-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.reic-image-preview {
    text-align: center;
}

.reic-image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.reic-image-preview img:hover {
    transform: scale(1.02);
}

.reic-image-info {
    margin-top: 15px;
    font-size: 14px;
    color: #666;
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* スタイルセクション */
.reic-style-section {
    margin-bottom: 35px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.reic-style-section h3 {
    margin-bottom: 25px;
    color: #333;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

.reic-style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.reic-style-option {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    position: relative;
    overflow: hidden;
}

.reic-style-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 124, 186, 0.1), transparent);
    transition: left 0.5s ease;
}

.reic-style-option:hover::before {
    left: 100%;
}

.reic-style-option:hover {
    border-color: #007cba;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 124, 186, 0.2);
}

.reic-style-option.selected {
    border-color: #007cba;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.3);
}

.reic-style-option.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    background: #007cba;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.reic-style-preview img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.reic-style-option:hover .reic-style-preview img {
    transform: scale(1.05);
}

.reic-style-option h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.reic-style-option p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

/* カスタムプロンプトセクション */
.reic-custom-prompt-section {
    margin-bottom: 35px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.reic-custom-prompt-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.reic-custom-prompt-section textarea {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.reic-custom-prompt-section textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* 生成セクション */
.reic-generate-section {
    text-align: center;
    margin-bottom: 35px;
}

.reic-cancel-button {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

.reic-cancel-button:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

.reic-cancel-button:active {
    transform: translateY(0);
}

.reic-generate-button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 12px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 250px;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
    position: relative;
    overflow: hidden;
}

.reic-generate-button::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 ease;
}

.reic-generate-button:hover::before {
    left: 100%;
}

.reic-generate-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.reic-generate-button:disabled {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.reic-button-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.reic-spinner {
    animation: spin 1s linear infinite;
}

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

/* 結果セクション */
.reic-result-section {
    margin-top: 35px;
    padding: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reic-result-section h3 {
    margin-bottom: 25px;
    color: #333;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

.reic-result-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.reic-result-image {
    flex: 1;
    text-align: center;
}

.reic-result-image img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.reic-result-image img:hover {
    transform: scale(1.02);
}

.reic-result-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 180px;
}

.reic-action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.reic-action-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 124, 186, 0.1), transparent);
    transition: left 0.3s ease;
}

.reic-action-button:hover::before {
    left: 100%;
}

.reic-action-button:hover {
    background: #f8f9fa;
    border-color: #007cba;
    color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.2);
}

.reic-share-button:hover {
    background: #f8f9fa;
}

/* アラート */
.reic-alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    animation: slideInDown 0.4s ease-out;
}

.reic-alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.reic-alert.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .reic-converter-container {
        padding: 15px;
        margin: 10px;
    }
    
    .reic-style-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .reic-result-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .reic-result-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        min-width: auto;
    }
    
    .reic-upload-area {
        padding: 40px 15px;
    }
    
    .reic-upload-content h3 {
        font-size: 20px;
    }
    
    .reic-generate-button {
        min-width: 200px;
        padding: 15px 30px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .reic-style-grid {
        grid-template-columns: 1fr;
    }
    
    .reic-result-actions {
        flex-direction: column;
    }
    
    .reic-action-button {
        justify-content: center;
    }
    
    .reic-upload-content h3 {
        font-size: 18px;
    }
    
    .reic-generate-button {
        min-width: 180px;
        padding: 12px 25px;
        font-size: 16px;
    }
}

/* アクセシビリティ */
.reic-style-option:focus {
    outline: 3px solid #007cba;
    outline-offset: 2px;
}

.reic-generate-button:focus {
    outline: 3px solid #28a745;
    outline-offset: 2px;
}

.reic-action-button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* タッチデバイス対応 */
.touch-device .reic-style-option {
    padding: 25px 20px;
}

.touch-device .reic-action-button {
    padding: 15px 20px;
    font-size: 16px;
}

/* モバイル対応 */
.mobile .reic-converter-container {
    padding: 10px;
}

.mobile .reic-upload-area {
    padding: 30px 10px;
}

.mobile .reic-style-option {
    padding: 15px;
}

/* アニメーション */
.reic-fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

/* ローディング状態 */
.reic-loading {
    position: relative;
    overflow: hidden;
}

.reic-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}