/* 全体のスタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ヘッダー */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
}

/* 検索フォーム */
.search-form {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[type="text"]:hover,
.form-group input[type="number"]:hover,
.form-group select:hover {
    border-color: #c1c9d0;
}

/* チェックボックスグループ */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
    background: #fafafa;
}

.checkbox-item {
    display: flex;
    align-items: center;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.checkbox-item label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: normal;
}

/* 範囲入力 */
.range-inputs {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    background: #fafafa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.range-input {
    flex: 1;
    min-width: 200px;
}

.range-input label {
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    display: block;
}

.range-input input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.range-input input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.range-input input[type="number"]::placeholder {
    color: #999;
    font-style: italic;
}

/* 数値入力フィールドのスピンボタンのスタイリング */
.range-input input[type="number"]::-webkit-outer-spin-button,
.range-input input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.range-input input[type="number"] {
    -moz-appearance: textfield;
}

/* ホバー効果 */
.range-input input[type="number"]:hover {
    border-color: #c1c9d0;
}

/* 並び順セレクト */
.form-group select {
    display: inline-block;
    width: auto;
    min-width: 150px;
    margin-right: 10px;
}

/* ボタンスタイル */
.form-actions {
    text-align: center;
    margin-top: 30px;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

button:active {
    transform: translateY(0);
}

#reset-btn {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

#favorites-btn {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

#favorites-btn:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
}

/* 検索結果エリア */
.search-results {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.results-info {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #555;
    text-align: center;
}

/* 映画リスト */
.movie-list {
    display: grid;
    gap: 20px;
}

.movie-item {
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    padding: 20px;
    background: #fafafa;
    transition: all 0.3s ease;
}

.movie-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.movie-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    gap: 10px;
}

.movie-title a {
    color: #667eea;
    text-decoration: none;
}

.movie-title a:hover {
    text-decoration: underline;
}

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.movie-meta span {
    background: #e8f2ff;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.movie-synopsis {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.movie-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    background: #f0f0f0;
    color: #555;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.tag.genre {
    background: #e3f2fd;
    color: #1976d2;
}

.tag.streaming {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* 読み込みボタン */
#load-more-container {
    text-align: center;
    margin-top: 30px;
}

#load-more-btn {
    background: linear-gradient(135deg, #52c234 0%, #42a5f5 100%);
}

/* ローディング・メッセージ */
.loading, .no-results {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}

.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.no-results {
    color: #999;
    font-style: italic;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .search-form, .search-results {
        padding: 20px;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
        max-height: 150px;
    }
    
    .range-inputs {
        flex-direction: column;
        gap: 15px;
    }
    
    .range-input {
        min-width: 100%;
    }
    
    .movie-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    button {
        display: block;
        width: 100%;
        margin: 10px 0;
    }
}

/* お気に入りボタン */
.favorite-btn {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    color: #94a3b8;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(148, 163, 184, 0.2);
}

.favorite-btn:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #64748b;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(148, 163, 184, 0.3);
}

.favorite-btn:active {
    transform: scale(0.95);
}

.favorite-btn.favorited {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-color: #f59e0b;
    color: white;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.favorite-btn.favorited:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: #d97706;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.4);
}

.favorite-btn.disabled {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-color: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.6;
}

.favorite-btn.disabled:hover {
    transform: none;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    box-shadow: 0 2px 4px rgba(203, 213, 225, 0.2);
}

/* ローディング中の無効化 */
.favorite-btn.disabled:not(.favorited) {
    pointer-events: none;
}

/* あらすじ展開ボタン */
.read-more-btn,
.read-less-btn {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 8px;
    margin: 0 0 0 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    text-decoration: underline;
}

.read-more-btn:hover,
.read-less-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #5a67d8;
    transform: none;
    box-shadow: none;
}

.synopsis-text {
    line-height: 1.6;
}

.synopsis-short,
.synopsis-full {
    display: inline;
}

/* 検索パネル開閉 */
.search-panel-header {
    background: white;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
}

.search-toggle-btn {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px 10px 0 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.search-toggle-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-1px);
}

.toggle-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.search-toggle-btn.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.search-form {
    border-radius: 0 0 10px 10px;
    margin-top: 0;
    margin-bottom: 30px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-form-open {
    max-height: 1000px;
    opacity: 1;
}

.search-form-closed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 10px;
} 