/* ===========================
   マッチングシステム統一CSS
   =========================== */

/* マッチングフィルター */
.matching-filters {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 32px;
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
    border: 1px solid #e8e8e8;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    padding-right: 40px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 15px;
    background-color: #f8f9fa;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.form-select:hover {
    background-color: #ffffff;
    border-color: #4a90e2;
}

.form-select:focus {
    outline: none;
    border-color: #4a90e2;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.15);
}

/* 検索ボタン */
.matching-filters .btn-primary {
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border: none;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: center;
}

.matching-filters .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
    background: linear-gradient(135deg, #357abd 0%, #2968a3 100%);
}

.matching-filters .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

/* マッチング統計 */
.matching-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 8px;
}

.results-count {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-options label {
    font-size: 14px;
    color: #6c757d;
}

.sort-options .form-select {
    width: auto;
    min-width: 180px;
}

/* マッチンググリッド */
.matching-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

/* マッチングカード */
.matching-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.3s ease;
    min-height: 480px;
    display: flex;
    flex-direction: column;
}

.matching-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* マッチングスコア */
.matching-score {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #4a90e2;
    color: white;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

/* アバター */
.matching-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: block;
    object-fit: cover;
}

.matching-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 16px;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #8e8e93;
}

/* カード情報 */
.matching-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    text-align: center;
}

.matching-title {
    font-size: 14px;
    color: #6c757d;
    text-align: center;
    margin-bottom: 4px;
}

.matching-company {
    font-size: 14px;
    color: #495057;
    text-align: center;
    margin-bottom: 16px;
}

/* タグ */
.matching-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: center;
}

.tag {
    background: #e8f0fe;
    color: #1967d2;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 16px;
    white-space: nowrap;
}

/* マッチ理由 */
.match-reasons {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.match-reasons i {
    color: #ffc107;
}

/* アクションボタン */
.matching-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 16px;
}

.matching-actions .btn {
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
}

/* ボタンスタイル */
.btn-primary {
    background: #4a90e2;
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #357abd;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-outline {
    background: white;
    color: #4a90e2;
    border: 2px solid #4a90e2;
}

.btn-outline:hover {
    background: #4a90e2;
    color: white;
}

/* ブックマークボタン */
.bookmark-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bookmark-btn:hover {
    background: #f8f9fa;
    border-color: #4a90e2;
}

.bookmark-btn i {
    font-size: 16px;
    color: #6c757d;
}

.bookmark-btn i.fas {
    color: #4a90e2;
}

/* プロフィールモーダル */
.profile-modal .modal-content {
    max-width: 600px;
}

.profile-header {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #8e8e93;
}

.profile-info {
    flex: 1;
}

.profile-info h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.profile-title {
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 16px;
}

.profile-email,
.profile-phone,
.profile-line {
    font-size: 14px;
    color: #495057;
    margin-bottom: 8px;
}

.profile-email i,
.profile-phone i,
.profile-line i {
    width: 20px;
    margin-right: 8px;
    color: #6c757d;
}

/* プロフィールセクション */
.profile-section {
    margin-bottom: 24px;
}

.profile-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #212529;
}

.profile-section p {
    color: #495057;
    line-height: 1.6;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.challenges-list {
    list-style: none;
    padding: 0;
}

.challenges-list li {
    padding: 8px 0;
    color: #495057;
    position: relative;
    padding-left: 20px;
}

.challenges-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #4a90e2;
}

/* メッセージモーダル */
.message-modal textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
}

/* 空の状態 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

/* ボタン状態 */
.btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-success {
    background: #28a745;
    border-color: #28a745;
}

/* トースト通知 */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 10000;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-success i {
    color: #28a745;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-error i {
    color: #dc3545;
}

.toast-info {
    border-left: 4px solid #17a2b8;
}

.toast-info i {
    color: #17a2b8;
}

/* レーダーチャート（6角形グラフ） */
.matching-radar {
    width: 100%;
    height: 280px;  /* profile-detail-modalと統一（260px + padding 20px） */
    margin: 16px 0;
    position: relative;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 10px;
    box-sizing: border-box;
}

.matching-radar canvas {
    display: block;
    margin: 0 auto;
    /* width/heightはHTML属性で指定するため、CSSでは設定しない */
}

.radar-chart-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

/* プロフィール詳細モーダル内のレーダーチャート */
.profile-detail-radar {
    width: 300px;
    height: 300px;
    margin: 20px auto;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* マッチング理由 */
.match-reasons {
    background: #e8f5e9;
    padding: 12px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
    color: #2e7d32;
    display: flex;
    align-items: center;
    gap: 8px;
}

.match-reasons i {
    color: #4caf50;
}

/* アバタープレースホルダー */
.matching-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    color: #6c757d;
    font-size: 32px;
}

/* タグコンテナ */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* 共通スキル表示 */
.common-skills {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 10px 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
}

.common-skills i {
    color: #4caf50;
    margin-right: 6px;
}

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-top: 48px;
    padding: 24px 0;
}

.pagination .btn-outline {
    padding: 10px 20px;
    border: 2px solid #e1e8ed;
    background: white;
    color: #6c757d;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pagination .btn-outline:hover:not(:disabled) {
    border-color: #4a90e2;
    color: #4a90e2;
    background: #f0f7ff;
    transform: translateX(0);
}

.pagination .btn-outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .btn-outline:first-child:hover:not(:disabled) {
    transform: translateX(-2px);
}

.pagination .btn-outline:last-child:hover:not(:disabled) {
    transform: translateX(2px);
}

/* ページ番号 */
.page-numbers {
    display: flex;
    gap: 8px;
}

.page-number {
    width: 40px;
    height: 40px;
    border: 2px solid #e1e8ed;
    background: white;
    color: #495057;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-number:hover {
    border-color: #4a90e2;
    color: #4a90e2;
    background: #f0f7ff;
    transform: translateY(-2px);
}

.page-number.active {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
    transform: scale(1.1);
}

.page-number:active {
    transform: scale(0.95);
}

/* レスポンシブ */
@media (max-width: 768px) {
    /* フィルター */
    .matching-filters {
        padding: 16px;
        gap: 12px;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .matching-filters .btn-primary {
        width: 100%;
        padding: 14px;
    }
    
    /* ページネーション */
    .pagination {
        gap: 12px;
        margin-top: 32px;
    }
    
    .pagination .btn-outline {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .page-number {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .page-numbers {
        gap: 4px;
    }
    
    /* マッチンググリッド */
    .matching-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-avatar,
    .profile-avatar-placeholder {
        margin: 0 auto;
    }

    .matching-actions {
        grid-template-columns: 1fr;
    }
    
    .matching-radar,
    .profile-detail-radar {
        width: 250px;
        height: 250px;
    }
}

/* プロフィールモーダル専用スタイル */
.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.2s ease-in-out;
}

.profile-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.profile-modal .modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

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

.profile-modal .modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
}

.profile-modal .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 4px 8px;
    transition: all 0.2s;
    border-radius: 4px;
}

.profile-modal .modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.profile-modal .modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

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

/* マッチングカードの追加スタイル */
.matching-score {
    background: #4a90e2;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    position: absolute;
    top: 16px;
    right: 16px;
    font-weight: 600;
    z-index: 1;
}

.common-skills {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 14px;
    text-align: center;
}

.common-skills i {
    margin-right: 4px;
}

.bookmark-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 1;
}

.bookmark-btn:hover {
    background: #f5f7fa;
    border-color: #4a90e2;
    color: #4a90e2;
}

/* プロフィールモーダルのプロフィールヘッダー */
.profile-modal .profile-header {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.profile-modal .profile-avatar,
.profile-modal .profile-avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-modal .profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-modal .profile-avatar-placeholder {
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #999;
}

.profile-modal .profile-info h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
}

.profile-modal .profile-section {
    margin-top: 24px;
}

.profile-modal .profile-section h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.profile-modal .tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-modal .tag {
    background: #e8f0fe;
    color: #1967d2;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
}

/* ページネーションボタンの完璧なスタイル */
.pagination .page-number {
    width: 40px;
    height: 40px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination .page-number:hover {
    background: #f5f7fa;
    border-color: #4a90e2;
    color: #4a90e2;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15);
}

.pagination .page-number.active {
    background: #4a90e2;
    color: white;
    border-color: #4a90e2;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.25);
}

.pagination .page-number.active:hover {
    background: #357abd;
    border-color: #357abd;
    transform: none;
}

.pagination .page-number:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.pagination .page-number:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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