/**
 * Query Builder Component
 * Google検索クエリビルダー用スタイル
 * Version: 1.4
 *
 * Used by:
 * - MakeGoogleSearchKeywords
 *
 * Features:
 * - Sticky query result area (desktop)
 * - Uses shared components.css for form controls
 * - Responsive mobile layout
 * - Unified radio button styles
 * - Grid layouts for multi-input fields
 *
 * Changelog:
 * v1.4 - Removed .form-control/.form-label overrides to use components.css
 * v1.3 - Added compact form spacing
 * v1.2 - Added radio groups and grid layouts
 * v1.1 - Initial version
 */

/* Query Result Area (Sticky on Desktop) */
.query-result-sticky {
    position: sticky;
    top: 80px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--primary-color);
    z-index: 10;
}

.query-result-sticky textarea {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-family: monospace;
    background: white;
    min-height: 80px;
    resize: vertical;
}

.query-result-sticky .btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 500;
    margin-top: 12px;
}

/* Form Inputs Container */
.query-form-inputs {
    max-width: 800px;
}

/* Compact form group spacing for query builder */
.query-form-inputs .form-group {
    margin-bottom: 16px;
}

/* Section Dividers */
.section-divider {
    margin: 24px 0;
    border: none;
    border-top: 1px solid var(--gray-200);
}

/* Section Titles */
.section-title {
    margin-bottom: 16px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

/* Exclude Keywords Grid */
.exclude-keywords-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

/* Radio Inline Group (for intitle/allintitle, etc.) */
.radio-inline-group {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.radio-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    cursor: pointer;
    font-weight: normal;
}

.radio-inline input[type="radio"] {
    cursor: pointer;
}

/* Radio with Input (for special searches) */
.radio-with-input {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    font-weight: 500;
}

.radio-with-input input[type="radio"] {
    cursor: pointer;
}

/* Sub-form control (indented inputs after radio) */
.form-control-sub {
    margin-top: 8px;
    margin-left: 24px;
}

/* Range Input Group (for number range) */
.range-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.range-separator {
    font-weight: 500;
    color: var(--gray-600);
}

/* Calculator Input Group */
.calculator-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

/* FAQ Styles */
.faq-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
}

.faq-item-border {
    border-bottom: 1px solid var(--gray-200);
}

.faq-question {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.faq-answer {
    margin-top: 8px;
    color: var(--gray-700);
}

/* Related Tools Grid */
.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.related-tool-title {
    font-size: 1em;
    margin-bottom: 4px;
}

.related-tool-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.related-tool-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.related-tool-desc {
    font-size: 0.9em;
    color: #666;
    margin: 0;
}

/* Mobile: Remove sticky behavior */
@media (max-width: 991px) {
    .query-result-sticky {
        position: relative;
        top: 0;
    }

    .exclude-keywords-grid {
        grid-template-columns: 1fr;
    }

    .related-tools-grid {
        grid-template-columns: 1fr;
    }
}
