/* 小浜島日記検索フォームスタイル */
.diary-search-form {
    margin: 2rem 0;
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.search-field {
    flex: 1;
    padding: 12px 16px;
    padding-right: 50px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: var(--input-bg, #ffffff);
    color: var(--text-color, #333333);
    transition: all 0.3s ease;
}

.search-field:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search-submit {
    position: absolute;
    right: 8px;
    padding: 8px;
    background: #4a90e2;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-submit:hover {
    background: #357abd;
}

.search-submit svg {
    width: 20px;
    height: 20px;
}

.search-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 14px;
    color: var(--text-secondary, #666666);
    margin-bottom: 0.5rem;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: var(--input-bg, #ffffff);
    color: var(--text-color, #333333);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: #4a90e2;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg, #ffffff);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:hover {
    background: #f5f5f5;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-number {
    color: #4a90e2;
    font-weight: bold;
    margin-right: 8px;
}

.suggestion-title {
    color: var(--text-color, #333333);
}

.suggestion-date {
    color: var(--text-secondary, #999999);
    font-size: 12px;
    margin-left: 8px;
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .diary-search-form {
        background: #1a1f2e;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }

    .search-field {
        background: #0f1419;
        color: #e2e8f0;
        border-color: rgba(142, 238, 231, 0.2);
    }

    .search-field::placeholder {
        color: #718096;
    }

    .search-field:focus {
        border-color: #8eeee7;
        box-shadow: 0 0 0 3px rgba(142, 238, 231, 0.1);
    }

    .search-submit {
        background: linear-gradient(135deg, #5fd4cd 0%, #3db5ad 100%);
    }

    .search-submit:hover {
        background: linear-gradient(135deg, #8eeee7 0%, #5fd4cd 100%);
    }

    .filter-group label {
        color: #cbd5e0;
    }

    .filter-group select {
        background: #0f1419;
        color: #e2e8f0;
        border-color: rgba(142, 238, 231, 0.2);
    }

    .filter-group select:focus {
        border-color: #8eeee7;
    }

    .filter-group select option {
        background: #0f1419;
        color: #e2e8f0;
    }

    .search-suggestions {
        background: #1a1f2e;
        border-color: rgba(142, 238, 231, 0.2);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .suggestion-item {
        border-bottom-color: rgba(142, 238, 231, 0.1);
    }

    .suggestion-item:hover {
        background: rgba(142, 238, 231, 0.08);
    }

    .suggestion-number {
        color: #8eeee7;
    }

    .suggestion-title {
        color: #e2e8f0;
    }

    .suggestion-date {
        color: #718096;
    }
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .diary-search-form {
        padding: 1rem;
    }

    .search-filters {
        grid-template-columns: 1fr;
    }

    .search-field {
        font-size: 16px; /* iOSでのズーム防止 */
    }
}