/* ===================================
   プログラム検索モーダル用CSS
   =================================== */

/* 検索ボタン */
.search-button-container {
    margin: 1.5rem 0;
    padding: 0;
}

.open-search-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: #ffffff;
    color: #5591af;
    border: 2px solid #5591af;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(85, 145, 175, 0.12);
}

.open-search-button:hover {
    background: linear-gradient(135deg, #5591af 0%, #4a7a8c 100%);
    color: white;
    border-color: #4a7a8c;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(85, 145, 175, 0.25);
}

.open-search-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(85, 145, 175, 0.2);
}

.open-search-button svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.open-search-button:hover svg {
    transform: scale(1.1);
}

/* 検索モーダル背景 */
.search-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

/* 検索モーダルコンテンツ */
.search-modal-content {
    background-color: #ffffff;
    margin: 2% auto;
    padding: 0;
    width: 90%;
    max-width: 1100px;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s ease;
}

/* 検索モーダルヘッダー */
.search-modal-header {
    padding: 24px 30px;
    background: linear-gradient(135deg, #5591af 0%, #4a7a8c 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* 検索モーダルボディ */
.search-modal-body {
    padding: 30px;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

/* 検索入力エリア */
.search-input-container {
    position: sticky;
    top: -30px;
    background: white;
    padding-bottom: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 2px solid #e0e0e0;
}

.search-input-container svg {
    color: #5591af;
    flex-shrink: 0;
}

.search-input-container input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input-container input:focus {
    outline: none;
    border-color: #5591af;
    box-shadow: 0 0 0 4px rgba(85, 145, 175, 0.1);
}

/* 検索ヘルプ */
.search-help {
    margin: 16px 0;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #5591af;
}

.search-help p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

/* 検索統計 */
.search-stats {
    display: none;
    margin: 20px 0 16px;
    font-size: 1rem;
    font-weight: 600;
    color: #5591af;
}

/* 検索結果リスト */
.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 検索結果アイテム */
.search-result-item {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.search-result-item:hover {
    border-color: #5591af;
    box-shadow: 0 4px 16px rgba(85, 145, 175, 0.15);
    transform: translateY(-2px);
}

/* 結果ヘッダー */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.result-id {
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    background: linear-gradient(135deg, #5591af 0%, #4a7a8c 100%);
    padding: 6px 14px;
    border-radius: 6px;
    white-space: nowrap;
}

.result-os {
    font-size: 0.9rem;
    color: #666;
    background: #f0f0f0;
    padding: 6px 12px;
    border-radius: 6px;
    flex: 1;
    min-width: 200px;
}

/* 結果タイトル */
.result-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    line-height: 1.6;
    margin-bottom: 12px;
}

.result-title mark {
    background-color: #fff176;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 700;
}

/* 結果著者 */
.result-authors {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.result-authors svg {
    flex-shrink: 0;
    margin-top: 3px;
}

.result-authors mark {
    background-color: #fff176;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* スケジュール情報 */
.result-schedule {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
    padding: 10px 0;
    border-top: 1px solid #e0e0e0;
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #555;
}

.schedule-item svg {
    color: #5591af;
    flex-shrink: 0;
}

/* 時間情報バッジ */
.result-time-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.time-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.spotlight-badge {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

.spotlight-badge svg {
    color: #e65100;
}

.interactive-badge {
    background: #fce4ec;
    color: #880e4f;
    border: 1px solid #f8bbd0;
}

.interactive-badge svg {
    color: #880e4f;
}

/* 検索結果なし */
.no-search-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-search-results svg {
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-search-results p {
    font-size: 1.1rem;
    margin: 10px 0;
}

.search-hint {
    font-size: 0.9rem !important;
    color: #aaa !important;
}

/* スクロールバーのスタイル */
.search-modal-body::-webkit-scrollbar {
    width: 10px;
}

.search-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.search-modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #5591af 0%, #4a7a8c 100%);
    border-radius: 5px;
}

.search-modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #4a7a8c 0%, #3a5a6c 100%);
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
    .search-modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 90vh;
    }
    
    .search-modal-header {
        padding: 20px;
    }
    
    .search-modal-header h2 {
        font-size: 1.2rem;
    }
    
    .search-modal-body {
        padding: 20px;
        max-height: calc(90vh - 90px);
    }
    
    .search-input-container input {
        font-size: 0.95rem;
        padding: 12px 16px;
    }
    
    .search-result-item {
        padding: 16px;
    }
    
    .result-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .result-os {
        min-width: auto;
    }
    
    .result-schedule {
        flex-direction: column;
        gap: 8px;
    }
    
    .open-search-button {
        padding: 13px 24px;
        font-size: 0.98rem;
        border-width: 2px;
    }
    
    .open-search-button svg {
        width: 19px;
        height: 19px;
    }
}

@media screen and (max-width: 480px) {
    .search-modal-content {
        width: 100%;
        margin: 0;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .search-modal-header {
        border-radius: 0;
        padding: 16px;
    }
    
    .search-modal-header h2 {
        font-size: 1.1rem;
        gap: 8px;
    }
    
    .search-modal-header h2 svg {
        width: 20px;
        height: 20px;
    }
    
    .search-modal-close {
        width: 36px;
        height: 36px;
    }
    
    .search-modal-body {
        padding: 16px;
    }
    
    .search-input-container input {
        font-size: 0.9rem;
        padding: 10px 14px;
    }
    
    .result-title {
        font-size: 1rem;
    }
    
    .result-authors {
        font-size: 0.85rem;
    }
    
    .time-badge {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
    
    .open-search-button {
        padding: 12px 20px;
        font-size: 0.95rem;
        border-width: 2px;
    }
    
    .open-search-button svg {
        width: 18px;
        height: 18px;
    }
}

/* アクセシビリティ: フォーカス時のアウトライン */
.search-modal-close:focus,
.open-search-button:focus {
    outline: 2px solid #5591af;
    outline-offset: 2px;
}

.search-input-container input:focus {
    outline: none;
}

/* プリントスタイル */
@media print {
    .search-modal,
    .open-search-button {
        display: none !important;
    }
}

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

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
