* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid #667eea;
    position: relative;
}

/* 背景画像付きヘッダー */
.header-with-bg {
    background-image: url('hideme-ogp.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.header-with-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 0;
}

.header-with-bg h1,
.header-with-bg .subtitle {
    position: relative;
    z-index: 1;
}

h1 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 10px;
}

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

/* モバイル対応 */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8em;
    }
}

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

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

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

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

.info-box {
    font-size: 0.95em;
    line-height: 1.6;
}

.info-box ol {
    font-size: 0.9em;
}

.info-box li {
    margin-bottom: 5px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.status {
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    min-width: 200px;
}

.status.loading {
    background: #fff3cd;
    color: #856404;
}

.status.success {
    background: #d4edda;
    color: #155724;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
}

/* 注意事項セクションの幅制限 */
.notice-section {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* メインコンテンツエリア（フィルターから結果まで） */
.main-content {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    max-width: 1200px;
    margin: 0 auto 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-section {
    background: transparent;
    padding: 0;
    border-radius: 0;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

/* 最後のフィルターセクションはボーダーなし */
.filter-section:last-of-type {
    border-bottom: none;
}

.filter-section h2 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.5em;
}

/* 公開年フィルターの幅制限 */
.filter-section > div[style*="flex"] {
    max-width: 600px;
}

.country-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    padding: 8px 16px;
    background: white;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.checkbox-label:hover {
    background: #e9ecef;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.results-section h2 {
    margin-bottom: 20px;
    color: #495057;
    font-size: 1.5em;
}

.results-section {
    background: transparent;
    padding: 0;
    margin: 0;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    padding-left: 40px; /* 行番号のスペース */
    position: relative;
}

.result-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.result-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-info {
    padding: 20px;
}

.result-title {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 8px;
    color: #212529;
    line-height: 1.4;
    min-height: 2.8em;
}

.result-meta {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
}

.result-rating {
    font-size: 0.9em;
    color: #ff9800;
    margin-bottom: 8px;
    font-weight: 600;
}

.result-synopsis {
    font-size: 0.85em;
    color: #6c757d;
    margin-bottom: 10px;
    line-height: 1.5;
    max-height: 3em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: pre-wrap;
    word-break: break-all;
}

.result-countries {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.country-badge {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 1.1em;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    position: relative;
}

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

.modal-close {
    color: #aaa;
    float: right;
    font-size: 35px;
    font-weight: bold;
    line-height: 30px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover,
.modal-close:focus {
    color: #667eea;
}

.modal-image-container {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 20px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image-container img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.modal-content h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.8em;
    line-height: 1.4;
}

.modal-content h3 {
    color: #667eea;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.modal-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 1em;
    color: #6c757d;
}

.modal-meta span {
    font-weight: 500;
}

.modal-countries {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

#modalSynopsis {
    font-size: 1.05em;
    line-height: 1.8;
    color: #444;
    white-space: pre-wrap;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2em;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .country-filters {
        gap: 10px;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }

    .modal-content h2 {
        font-size: 1.4em;
    }

    .modal-image-container {
        max-height: 250px;
    }
}


/* シェアボタン */
.share-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    padding: 0;
}

.share-button:hover {
    color: #667eea;
    transform: scale(1.1);
}

.share-button svg {
    pointer-events: none;
    width: 28px;
    height: 28px;
}

/* トースト通知 */
.copy-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10000;
    font-size: 14px;
}

.copy-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* 作品が見つからないモーダル */
.not-found-modal {
    max-width: 500px;
    text-align: center;
}

.not-found-content {
    padding: 20px;
}

.warning-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

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

.not-found-modal h2 {
    color: #ff6b6b;
    font-size: 20px;
    margin-bottom: 24px;
    font-weight: 600;
}

.not-found-message {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: left;
}

.not-found-message p {
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.not-found-message ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.not-found-message li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: #555;
    line-height: 1.6;
}

.not-found-message li::before {
    content: "・";
    position: absolute;
    left: 8px;
    font-weight: bold;
}

.sub-note {
    font-size: 0.9em;
    color: #666;
    margin-left: 8px;
}

.not-found-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .share-button {
        width: 35px;
        height: 35px;
        bottom: 15px;
        right: 15px;
    }
    
    .share-button svg {
        width: 22px;
        height: 22px;
    }
    
    .not-found-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
}

/* 検索ボックス */
.search-container {
    position: relative;
    margin-bottom: 10px;
}

.search-box {
    width: 100%;
    padding: 12px 45px 12px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

.clear-search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: #ddd;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 20px;
    color: #666;
}

.clear-search-btn:hover {
    background: #bbb;
    transform: translateY(-50%) scale(1.1);
}

.search-hint {
    font-size: 14px;
    color: #666;
    margin: 0;
    font-style: italic;
}
