/* 顔モザイク処理ツール 固有スタイル */

/* ツールコンテンツ */
.tool-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* アップロードセクション */
.upload-section {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.upload-area {
    border: 2px dashed var(--border-light);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s, background-color 0.3s;
    background: var(--bg-light);
}

.upload-area:hover {
    border-color: var(--primary-blue);
    background: rgba(41, 144, 208, 0.05);
}

.upload-area.dragover {
    border-color: var(--primary-blue);
    background: rgba(41, 144, 208, 0.05);
}

.upload-content .upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-medium);
}

.upload-content h2 {
    color: var(--text-dark);
    margin-bottom: 0.8rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.upload-content p {
    color: var(--text-medium);
    margin-bottom: 1.2rem;
    line-height: 1.5;
}

.upload-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 1rem;
}

.upload-btn:hover {
    background: var(--schit-blue);
    opacity: 0.9;
}

/* プレビューセクション */
.preview-section {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1.5rem;
}

.controls {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--bg-light);
}

.controls h3 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.controls-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.controls-row .control-group {
    flex: 1;
    min-width: 250px;
    margin-bottom: 0;
}

.control-group label {
    min-width: 100px;
    font-weight: 500;
    color: var(--text-dark);
}

.control-group select,
.control-group input[type="range"] {
    flex: 1;
    max-width: 200px;
}

.control-group select {
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: var(--white);
}

.control-group input[type="range"] {
    margin-right: 10px;
}

#intensity-value {
    min-width: 20px;
    font-weight: 500;
    color: #4a5568;
}

.action-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

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

.btn-primary {
    background: var(--primary-blue);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--schit-blue);
    opacity: 0.9;
}

.btn-secondary {
    background: var(--warning-orange);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #d89e3c;
}

.btn-success {
    background: var(--success-green);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #4caf50;
}

.btn-info {
    background: var(--primary-blue);
    color: white;
}

.btn-info:hover:not(:disabled) {
    background: #1e3e5f;
}

/* 画像コンテナ */
.image-container {
    text-align: center;
}

#preview-canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ローディング */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    min-width: 350px;
    max-width: 90vw;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* モデル読み込み表示 */
.model-loading {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: opacity 0.3s ease;
    z-index: 100;
}

.model-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.model-loading-content p {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #4a5568;
}

/* プログレスバー */
.progress-container {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--schit-blue));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-details {
    font-size: 0.9rem;
    color: #666;
    margin-top: 10px;
    text-align: left;
}

/* 利用案内の情報表示 */
.info-notice {
    background: rgba(41, 144, 208, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(41, 144, 208, 0.2);
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.info-notice h4 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-notice ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    list-style-type: disc;
}

.info-notice li {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* 画像情報表示 */
.image-info {
    background: rgba(41, 144, 208, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(41, 144, 208, 0.1);
    margin-bottom: 1.5rem;
}

.image-info h4 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(41, 144, 208, 0.1);
}

.info-label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.info-value {
    color: var(--primary-blue);
    font-size: 0.9rem;
    font-weight: 600;
}

@keyframes progress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* 顔枠リサイズハンドル */
.face-resize-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--primary-blue);
    border: 1px solid white;
    border-radius: 50%;
    cursor: se-resize;
    z-index: 10;
    display: none;
}

.face-resize-handle.active {
    display: block;
}

.face-resize-handle:hover {
    background: var(--schit-blue);
    transform: scale(1.2);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .upload-area {
        padding: 30px 15px;
    }

    .upload-content .upload-icon {
        font-size: 2rem;
    }

    .control-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .control-group label {
        min-width: auto;
        margin-bottom: 5px;
    }

    .control-group select,
    .control-group input[type="range"] {
        max-width: 100%;
        width: 100%;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .upload-content h2 {
        font-size: 1.3rem;
    }

    .upload-content p {
        font-size: 0.9rem;
    }
}
