/* モーダルウィンドウスタイル - オフホワイトベースデザイン */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid #ecf0f1;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #ecf0f1;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.25rem;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #ecf0f1;
    color: #2c3e50;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #ecf0f1;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #f8f9fa;
}

/* CSS アップロードエリア */
.css-upload-area {
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: #f8f9fa;
    margin-bottom: 20px;
}

.css-upload-area:hover,
.css-upload-area.dragover {
    border-color: #95a5a6;
    background: #ecf0f1;
}

.css-upload-area .upload-icon {
    color: #7f8c8d;
    margin-bottom: 16px;
}

.css-upload-area.dragover .upload-icon {
    color: #34495e;
}

.css-upload-area h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 500;
}

.css-upload-area p {
    margin: 0 0 16px 0;
    color: #7f8c8d;
}

.css-upload-area .file-info {
    margin-top: 16px;
}

.css-upload-area .file-info small {
    color: #95a5a6;
    font-size: 0.85rem;
}

/* CSS プレビューセクション */
.css-preview-section {
    margin-bottom: 20px;
}

.css-preview-section h4 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 500;
}

.css-preview-container {
    border: 1px solid #ecf0f1;
    border-radius: 6px;
    overflow: hidden;
}

/* CSS バリデーション結果 */
.css-validation-result {
    margin-bottom: 20px;
}

.css-validation-result h4 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 500;
}

.validation-status {
    padding: 12px;
    border-radius: 6px;
    font-weight: 500;
    margin-bottom: 12px;
}

.validation-status.valid {
    background: #f0f8f0;
    color: #27ae60;
    border: 1px solid #27ae60;
}

.validation-status.invalid {
    background: #fdf2f2;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.validation-details {
    max-height: 200px;
    overflow-y: auto;
}

.validation-violation {
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #fdf6e3;
    border: 1px solid #e67e22;
    border-radius: 4px;
    font-size: 0.9rem;
}

.validation-violation strong {
    color: #e67e22;
}

/* カスタムCSS管理 */
.custom-css-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-css-group label {
    color: #34495e;
}

.custom-css-select-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.css-upload-btn {
    background: #34495e;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.css-upload-btn:hover {
    background: #2c3e50;
    transform: translateY(-1px);
}

.css-upload-btn i {
    font-size: 0.8rem;
}

.css-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.css-preview-btn,
.css-delete-btn {
    background: none;
    border: 1px solid #bdc3c7;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #34495e;
}

.css-preview-btn:hover {
    background: #ecf0f1;
    border-color: #95a5a6;
}

.css-delete-btn:hover {
    background: #fdf2f2;
    border-color: #e74c3c;
    color: #e74c3c;
}

/* ボタンスタイル */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn.primary {
    background: #34495e;
    color: white;
}

.btn.primary:hover:not(:disabled) {
    background: #2c3e50;
    transform: translateY(-1px);
}

.btn.secondary {
    background: #95a5a6;
    color: white;
}

.btn.secondary:hover:not(:disabled) {
    background: #7f8c8d;
    transform: translateY(-1px);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 12px 20px;
        flex-direction: column;
    }
    
    .css-upload-area {
        padding: 30px 15px;
    }
    
    .custom-css-select-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .css-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 100%;
        margin: 10px;
        border-radius: 8px;
    }
    
    .css-upload-area {
        padding: 20px 10px;
    }
    
    .css-upload-area h4 {
        font-size: 1rem;
    }
}
