/**
 * Dynamic Job Filter Styles
 * 動的求人絞り込み検索フォーム用CSS
 */

/* フィルターフォームコンテナ */
.job-filter-form {
    border: 1px solid #e9ecef;
    border-radius: 15px;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.job-filter-form:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* フィルターフォームラベル */
.job-filter-form .form-label {
    color: #2c3e50;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.job-filter-form .form-label i {
    font-size: 1rem;
}

/* フィルターセレクトボックス */
.job-filter-form .form-select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background-color: #fff;
}

.job-filter-form .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

.job-filter-form .form-select:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
}

/* フィルターボタン */
.job-filter-form .btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.job-filter-form .btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    box-shadow: 0 3px 10px rgba(0, 123, 255, 0.3);
}

.job-filter-form .btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
}

.job-filter-form .btn-outline-secondary {
    border: 2px solid #6c757d;
    color: #6c757d;
}

.job-filter-form .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
    transform: translateY(-1px);
}

/* 結果カウンター */
#jobResultsCount {
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
}

/* 求人画像表示スタイル */
.job-image-container {
    position: relative;
    width: 100%;
    height: 160px;
    border-radius: 6px;
    overflow: hidden;
}

.job-thumbnail {
    width: 100%;
    height: 160px;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    /* モバイルChrome対応 */
    will-change: transform;
}

.job-thumbnail:hover {
    transform: scale(1.05);
}

.job-image-placeholder {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.job-image-placeholder .placeholder-content {
    flex-direction: column;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 2rem;
}

.job-image-placeholder .placeholder-content i {
    opacity: 0.5;
}

/* モバイルChrome画像表示最適化 */
@media screen and (-webkit-min-device-pixel-ratio: 2) {
    .job-thumbnail {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* iOS Safari対応 */
@supports (-webkit-touch-callout: none) {
    .job-thumbnail {
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
}

/* 求人カードスタイル - モダンなグラデーション背景 */
.job-card {
    border: none;
    border-radius: 15px;
    background: linear-gradient(to top, #dfe9f3 0%, white 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #2c3e50;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(30, 58, 138, 0.08);
    position: relative;
    z-index: 1;
}

.job-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%);
    animation: rotateBackground 20s linear infinite;
    z-index: 0;
    pointer-events: none;
}

.job-card .job-card-header,
.job-card .job-card-body,
.job-card .job-card-footer {
    position: relative;
    z-index: 2;
}

@keyframes rotateBackground {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* より強い回転効果の代替案 */
.job-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: conic-gradient(from 0deg, #ebf2f7, #eff5f9, #f0f6fb, #ebf2f7);
    border-radius: 15px;
    z-index: -1;
    animation: rotateBackground 15s linear infinite;
}

.job-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px rgba(30, 58, 138, 0.25);
}

.job-card-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(30, 58, 138, 0.1);
}

.job-card-body {
    padding: 1rem 1.5rem;
}

.job-card-footer {
    padding: 1rem 1.5rem 1.5rem;
    background-color: rgba(248, 249, 250, 0.5);
    backdrop-filter: blur(10px);
}

/* 応募ボタンの緑色強制適用 */
.job-card .btn-success,
#jobListings .btn-success,
[data-job-id] .btn-success {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: white !important;
}

.job-card .btn-success:hover,
#jobListings .btn-success:hover,
[data-job-id] .btn-success:hover {
    background-color: #157347 !important;
    border-color: #146c43 !important;
    color: white !important;
}

/* 求人カードデザイン統一の強制適用 */
#jobListings .job-card,
[data-job-id] .job-card {
    border: none !important;
    border-radius: 15px !important;
    background: linear-gradient(to top, #dfe9f3 0%, white 100%) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #2c3e50 !important;
    box-shadow: 0 10px 30px rgba(30, 58, 138, 0.08) !important;
}

/* 会社バッジ */
.company-badge {
    display: inline-block;
    background: rgba(30, 58, 138, 0.1);
    color: #1e3a8a;
    border: 1px solid rgba(30, 58, 138, 0.2);
    padding: 6px 16px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    letter-spacing: 0.3px;
}

/* 注目バッジ */
.featured-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 求人タイトル */
.job-title {
    color: #1e3a8a;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.4;
    margin: 0.5rem 0 0;
}

/* 求人詳細情報 */
.job-details {
    margin-bottom: 1rem;
}

.job-detail-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #495057;
}

.job-detail-item i {
    width: 16px;
    text-align: center;
    color: #0891b2;
}

/* 求人概要 */
.job-summary {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 結果なしメッセージ */
#noResultsMessage .alert {
    border: none;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    color: #1976d2;
    font-size: 1rem;
}

/* ローディングスピナー */
#loadingMessage {
    padding: 3rem 0;
}

#loadingMessage .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* もっと見るボタン */
#loadMoreJobs {
    border-radius: 50px;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid #007bff;
}

#loadMoreJobs:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .job-filter-form {
        padding: 1.5rem !important;
        margin-bottom: 1.5rem;
    }
    
    .job-filter-form .btn {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .job-filter-form .d-flex {
        flex-direction: column;
        gap: 1rem;
    }
    
    .job-filter-form .d-flex > div {
        text-align: center;
    }
    
    #jobResultsCount {
        text-align: center;
        display: block;
        margin-bottom: 0.5rem;
    }
    
    /* モバイル画像表示調整 */
    .job-image-container {
        height: 140px;
    }
    
    .job-thumbnail {
        height: 140px;
        /* モバイルChrome強制表示 */
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
    }
    
    .job-card-header,
    .job-card-body,
    .job-card-footer {
        padding: 1rem;
    }
    
    .job-title {
        font-size: 1rem;
    }
    
    .job-detail-item {
        font-size: 0.85rem;
    }
}

/* アニメーション効果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 求人カードのアニメーションは動的生成時に個別制御 */

/* フォーカスアクセシビリティ */
.job-filter-form .form-select:focus,
.job-filter-form .btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* プリント用CSS */
@media print {
    .job-filter-form,
    #loadMoreJobs {
        display: none !important;
    }
    
    .job-card {
        box-shadow: none;
        border: 1px solid #000;
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}
