/* 遺影写真変換サービス - スタイル */

:root {
    --color-bg: #fafafa;
    --color-surface: #ffffff;
    --color-text: #333333;
    --color-text-secondary: #666666;
    --color-text-muted: #999999;
    --color-primary: #4a5568;
    --color-primary-dark: #2d3748;
    --color-accent: #3182ce;
    --color-success: #38a169;
    --color-warning: #d69e2e;
    --color-error: #e53e3e;
    --color-border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ヘッダー */
.header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    letter-spacing: 0.05em;
}

.subtitle {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

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

.drop-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    background: var(--color-surface);
    transition: all 0.2s ease;
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--color-accent);
    background: rgba(49, 130, 206, 0.03);
}

.drop-zone.dragover {
    transform: scale(1.01);
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.drop-text {
    font-size: 1.1rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.drop-text-sub {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.file-select-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s ease;
}

.file-select-btn:hover {
    background: var(--color-primary-dark);
}

.file-info {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    margin-top: 1rem;
}

/* プレビューセクション */
.preview-section {
    margin-bottom: 2rem;
}

.preview-section h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.original-preview-container {
    background: var(--color-surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    margin-bottom: 1.5rem;
}

.original-preview-container img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--radius);
}

.file-name {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

/* オプション */
.options {
    padding: 1.5rem;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.option-label {
    display: block;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-option {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-option:hover {
    border-color: var(--color-accent);
    background: rgba(49, 130, 206, 0.02);
}

.radio-option input[type="radio"] {
    accent-color: var(--color-accent);
}

.radio-text {
    font-weight: 500;
}

.radio-desc {
    flex-basis: 100%;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-left: 1.5rem;
}

/* チェックボックスグループ */
.checkbox-group {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-option {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-option:hover {
    border-color: var(--color-accent);
    background: rgba(49, 130, 206, 0.02);
}

.checkbox-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-accent);
}

.checkbox-text {
    font-weight: 500;
}

.checkbox-desc {
    flex-basis: 100%;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-left: 1.75rem;
}

/* 目の位置セクション */
.eye-position-section {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: var(--color-bg);
    border-radius: var(--radius);
    border-left: 3px solid var(--color-accent);
}

.eye-position-section .option-label {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.eye-position-section .radio-group {
    gap: 0.5rem;
}

.eye-position-section .radio-option {
    padding: 0.6rem 0.8rem;
    background: var(--color-surface);
}

.eye-position-section .radio-desc {
    margin-left: 1.75rem;
    font-size: 0.8rem;
}

/* アクションボタン */
.action-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.convert-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 320px;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, var(--color-accent), #2b6cb0);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.convert-btn:active {
    transform: translateY(0);
}

.convert-btn:disabled {
    background: var(--color-text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-icon {
    font-size: 1.25rem;
}

.change-file-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.change-file-btn:hover {
    border-color: var(--color-text-secondary);
    color: var(--color-text);
}

/* モーダル */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none; /* デフォルトは非表示 */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

/* hidden属性がない場合のみ表示 */
.modal-overlay:not([hidden]) {
    display: flex;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--color-primary-dark);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* モーダル処理中 */
.modal-processing {
    padding: 4rem 2rem;
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.processing-text {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
}

/* 変換後画像 */
.converted-image-container {
    background: var(--color-bg);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 1rem;
}

.converted-image-container img {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.output-info {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* 品質チェック */
.quality-check {
    background: var(--color-bg);
    padding: 1rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--color-warning);
}

.quality-check h3 {
    font-size: 0.95rem;
    color: var(--color-text);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quality-check h3::before {
    content: "⚠";
}

.quality-list {
    list-style: none;
}

.quality-list li {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.quality-list li:last-child {
    border-bottom: none;
}

.quality-list li.info {
    color: var(--color-accent);
}

.quality-list li.warning {
    color: var(--color-warning);
}

.quality-list li.success {
    color: var(--color-success);
}

/* 成功時にボーダーを緑に */
.quality-check.all-good {
    border-left-color: var(--color-success);
}

.quality-check.all-good h3::before {
    content: "✓";
}

/* ダウンロードボタン */
.download-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--color-success);
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 600;
    transition: background 0.2s ease;
}

.download-btn:hover {
    background: #2f855a;
}

.modal-secondary-btn {
    padding: 0.75rem 1rem;
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-secondary-btn:hover {
    border-color: var(--color-text-secondary);
    color: var(--color-text);
}

/* エラー表示 */
.modal-error .modal-body {
    text-align: center;
}

.error-icon {
    width: 64px;
    height: 64px;
    background: var(--color-error);
    color: white;
    font-size: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.error-message {
    color: var(--color-error);
    font-size: 1rem;
}

/* フッター */
.footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.usage-guide {
    background: var(--color-surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.usage-guide h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--color-primary-dark);
}

.usage-guide ol {
    padding-left: 1.5rem;
    color: var(--color-text-secondary);
}

.usage-guide li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.related-service {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

.related-service a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.related-service a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.copyright {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

/* レスポンシブ */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 1.4rem;
    }
    
    .drop-zone {
        padding: 2rem 1rem;
    }
    
    .modal {
        max-height: 95vh;
        margin: 0.5rem;
    }
    
    .convert-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}
