/**
 * フロントエンド用CSS - コスメ査定プロ
 * Version: 1.0.0
 */

/* ==========================================================================
   リセット & ベースセッティング - 強制適用
   ========================================================================== */

/* 強制的にスタイルを適用 */
#cosme-assessment-main,
.cosme-assessment-pro,
.cosme-main-container {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    line-height: 1.6 !important;
    color: #333 !important;
    background: #f8f9fa !important;
    margin: 0 !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

#cosme-assessment-main *,
.cosme-assessment-pro *,
.cosme-main-container * {
    box-sizing: border-box !important;
}

.cosme-assessment-pro * {
    box-sizing: border-box;
}

.cosme-assessment-pro {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    margin: 0;
    padding: 20px;
}

/* ==========================================================================
   ヘッダーとナビゲーション
   ========================================================================== */

.cosme-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.cosme-header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.cosme-header .tagline {
    font-size: 1.2rem;
    margin-top: 0.5rem;
    opacity: 0.9;
}

/* ==========================================================================
   ヒーローセクション
   ========================================================================== */

.hero-section {
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
    border-radius: 15px;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-section h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-section p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn-hero {
    display: inline-block;
    padding: 15px 30px;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    color: #667eea;
}

/* ==========================================================================
   フィーチャーカード
   ========================================================================== */

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.feature-icon {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
    display: block;
}

.feature-card h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

/* ==========================================================================
   査定フォーム
   ========================================================================== */

.assessment-form-container {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
    font-weight: 600;
    position: relative;
    transition: all 0.3s ease;
}

.step.active {
    background: #667eea;
    color: white;
}

.step.completed {
    background: #28a745;
    color: white;
}

.step::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    width: 20px;
    height: 2px;
    background: #e9ecef;
    transform: translateY(-50%);
}

.step:last-child::after {
    display: none;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control.error {
    border-color: #dc3545;
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ==========================================================================
   バーコードスキャナー
   ========================================================================== */

.barcode-scanner-container {
    position: relative;
    background: #f8f9fa;
    border: 2px dashed #667eea;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    margin: 1rem 0;
}

.scanner-video {
    width: 100%;
    max-width: 400px;
    height: 300px;
    border-radius: 8px;
    background: #000;
}

.scanner-controls {
    margin-top: 1rem;
}

.btn-scanner {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 5px;
}

.btn-scanner:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.scanner-result {
    margin-top: 1rem;
    padding: 1rem;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    display: none;
}

.scanner-result.show {
    display: block;
}

/* ==========================================================================
   商品写真アップロード
   ========================================================================== */

.photo-upload-area {
    border: 2px dashed #667eea;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.photo-upload-area:hover,
.photo-upload-area.dragover {
    background: #e3f2fd;
    border-color: #4285f4;
}

.photo-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.photo-preview {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.photo-preview img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.photo-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
}

/* ==========================================================================
   店舗選択
   ========================================================================== */

.stores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.store-card {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1.5rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.store-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.store-card.selected {
    border-color: #667eea;
    background: #f0f4ff;
}

.store-card .check-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #667eea;
    font-size: 1.5rem;
    display: none;
}

.store-card.selected .check-icon {
    display: block;
}

.store-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.store-type {
    color: #667eea;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.store-features {
    color: #666;
    font-size: 0.875rem;
}

.response-time {
    color: #28a745;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* ==========================================================================
   ボタンスタイル
   ========================================================================== */

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    line-height: 1.5;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
    display: block;
}

/* ==========================================================================
   アラート・通知
   ========================================================================== */

.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    position: relative;
}

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

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

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* ==========================================================================
   モーダル
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
}

/* ==========================================================================
   データ表示テーブル
   ========================================================================== */

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 1px;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-processing {
    background: #d1ecf1;
    color: #0c5460;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

/* ==========================================================================
   レスポンシブデザイン
   ========================================================================== */

@media (max-width: 768px) {
    .cosme-assessment-pro {
        padding: 10px;
    }
    
    .cosme-header h1 {
        font-size: 2rem;
    }
    
    .hero-section h2 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1.1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .stores-grid {
        grid-template-columns: 1fr;
    }
    
    .step-indicator {
        flex-wrap: wrap;
    }
    
    .step {
        margin: 5px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .modal-content {
        margin: 20px;
        padding: 1.5rem;
    }
    
    .data-table {
        font-size: 0.875rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .cosme-header {
        padding: 1.5rem 1rem;
    }
    
    .hero-section {
        padding: 3rem 1rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .assessment-form-container {
        padding: 1.5rem;
    }
    
    .photo-preview-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* ==========================================================================
   アニメーション
   ========================================================================== */

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

/* ==========================================================================
   ロード中スピナー
   ========================================================================== */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.btn .loading-spinner {
    margin-right: 8px;
}

/* ==========================================================================
   緊急アクセス専用スタイル
   ========================================================================== */

.emergency-container {
    max-width: 600px;
    margin: 2rem auto;
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-left: 5px solid #dc3545;
}

.emergency-header {
    text-align: center;
    margin-bottom: 2rem;
}

.emergency-icon {
    font-size: 4rem;
    color: #dc3545;
    margin-bottom: 1rem;
    display: block;
}

.emergency-title {
    color: #dc3545;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.emergency-subtitle {
    color: #666;
    font-size: 1.1rem;
}

.diagnostic-results {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.diagnostic-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.diagnostic-item:last-child {
    border-bottom: none;
}

.status-ok {
    color: #28a745;
    font-weight: 600;
}

.status-error {
    color: #dc3545;
    font-weight: 600;
}

.btn-emergency {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-emergency:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

/* ==========================================================================
   プリント用スタイル
   ========================================================================== */

@media print {
    .cosme-assessment-pro {
        background: white;
        padding: 0;
    }
    
    .btn, .modal-overlay, .scanner-controls {
        display: none !important;
    }
    
    .feature-card, .store-card, .assessment-form-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .hero-section {
        background: #f8f9fa;
        color: #333;
    }
    
    .cosme-header {
        background: #333;
        color: white;
    }
}

/* ==========================================================================
   アクセシビリティ
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   ダークモード対応
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .cosme-assessment-pro {
        background: #1a1a1a;
        color: #e9ecef;
    }
    
    .feature-card, .store-card, .assessment-form-container,
    .modal-content, .data-table {
        background: #2d3748;
        color: #e9ecef;
    }
    
    .form-control {
        background: #4a5568;
        border-color: #718096;
        color: #e9ecef;
    }
    
    .form-control:focus {
        border-color: #667eea;
    }
    
    .data-table th {
        background: #4a5568;
        color: #e9ecef;
    }
    
    .data-table tbody tr:hover {
        background: #4a5568;
    }
}