/* /idea page — browse ideas */

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    align-items: stretch;
    background: #fff;
}

.idea-page {
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
    padding: 48px 24px 80px;
    box-sizing: border-box;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* ===== Hero ===== */

.idea-hero {
    margin-bottom: 48px;
}

.idea-hero-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.idea-hero-title {
    font-size: 22px;
    font-weight: 700;
    color: #111;
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.02em;
    flex: 1;
}

/* ===== Search toggle (magnifying glass) ===== */

.idea-search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #999;
    flex-shrink: 0;
    transition: color 0.15s;
}

.idea-search-toggle:hover {
    color: #555;
}

.idea-search-toggle-icon {
    width: 20px;
    height: 20px;
    display: block;
}

/* ===== Search field (inline, hidden by default) ===== */

.idea-search-wrap {
    position: relative;
    width: 240px;
    flex-shrink: 0;
}

.idea-search-wrap[hidden] {
    display: none;
}

.idea-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: #999;
    pointer-events: none;
}

.idea-search {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    background: #fafafa;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.idea-search:focus {
    outline: none;
    border-color: #bbb;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.idea-search::placeholder {
    color: #aaa;
}

/* ===== Grid ===== */

.idea-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* ===== Card ===== */

.idea-card {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 14px;
    padding: 20px;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.idea-card:hover {
    border-color: #ccc;
    background: #f5f5f5;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.idea-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.idea-card-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

.idea-card-icon img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.idea-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #111;
    line-height: 1.3;
}

.idea-card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.idea-card-badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.idea-card-badge-category {
    background: #f0f0f0;
    color: #555;
}

.idea-card-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    flex: 1;
}

.idea-card-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    margin-top: 4px;
}

.idea-card-star {
    color: #ddd;
    font-size: 12px;
}

.idea-card-star.filled {
    color: #f59e0b;
}

.idea-card-rating-count {
    color: #999;
    margin-left: 4px;
    font-size: 11px;
}

/* ===== Empty state ===== */

.idea-empty {
    text-align: center;
    padding: 48px 16px;
    color: #999;
    font-size: 14px;
}

/* ===== Footer ===== */

.idea-footer {
    text-align: center;
    margin-top: 48px;
}

.idea-submit-link {
    font-size: 14px;
    color: #666;
    text-decoration: none;
    transition: color 0.15s;
}

.idea-submit-link:hover {
    color: #111;
}

/* ===== Modal ===== */

.idea-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    justify-content: center;
    align-items: flex-start;
    padding-top: 10vh;
}

.idea-modal.open {
    display: flex;
}

.idea-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    animation: ideaFadeIn 0.15s ease;
}

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

@keyframes ideaSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.idea-modal-panel {
    position: relative;
    background: #fff;
    width: 560px;
    max-width: calc(100% - 32px);
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
    animation: ideaSlideUp 0.2s ease;
}

.idea-modal-close {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: #666;
    font-family: inherit;
    padding: 0;
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
}

.idea-modal-close:hover {
    color: #111;
}

.idea-modal-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.idea-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #111;
    margin: 0 0 8px;
}

.idea-modal-desc {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 12px;
}

.idea-modal-category {
    display: inline-block;
    font-size: 11px;
    padding: 3px 10px;
    background: #f0f0f0;
    color: #555;
    border-radius: 999px;
    font-weight: 600;
    margin-bottom: 20px;
}

.idea-modal-prompt-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.idea-modal-prompt {
    width: 100%;
    padding: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    background: #fafafa;
    color: #333;
    resize: none;
    line-height: 1.6;
    margin-bottom: 20px;
    min-height: 200px;
    field-sizing: content;
}

.idea-modal-prompt:focus {
    outline: none;
    border-color: #bbb;
}

.idea-modal-image-tag {
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    background: #fafafa;
    color: #333;
    margin-bottom: 20px;
}

.idea-modal-rating {
    margin-bottom: 20px;
}

.idea-modal-stars {
    display: flex;
    gap: 4px;
}

.idea-modal-star-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    color: #ddd;
    padding: 2px;
    transition: color 0.1s, transform 0.1s;
}

.idea-modal-star-btn:hover {
    transform: scale(1.15);
}

.idea-modal-star-btn.filled {
    color: #f59e0b;
}

.idea-modal-use-btn {
    display: block;
    width: 100%;
    padding: 14px 16px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s;
}

.idea-modal-use-btn:hover {
    background: #333;
}

/* ===== Submit form ===== */

.idea-submit-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.idea-submit-label {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 12px;
}

.idea-submit-label:first-child {
    margin-top: 0;
}

.idea-submit-input,
.idea-submit-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    background: #fafafa;
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.idea-submit-input:focus,
.idea-submit-textarea:focus {
    outline: none;
    border-color: #bbb;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.idea-submit-textarea {
    resize: vertical;
    line-height: 1.6;
    min-height: 120px;
}

.idea-submit-error {
    color: #dc3545;
    font-size: 13px;
    margin-top: 8px;
}

.idea-submit-error[hidden] {
    display: none;
}

.idea-submit-success {
    color: #28a745;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
}

.idea-submit-success[hidden] {
    display: none;
}

.idea-footer button.idea-submit-link {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    color: #666;
    padding: 0;
    transition: color 0.15s;
}

.idea-footer button.idea-submit-link:hover {
    color: #111;
}

/* ===== Mobile ===== */

@media (max-width: 600px) {
    .idea-page {
        padding: 24px 16px 60px;
    }

    .idea-hero-title {
        font-size: 18px;
    }

    .idea-search-wrap {
        width: 180px;
    }

    .idea-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .idea-modal-panel {
        padding: 24px;
        border-radius: 14px 14px 0 0;
        max-height: 90vh;
        align-self: flex-end;
        width: 100%;
        max-width: 100%;
    }

    .idea-modal {
        padding-top: 0;
        align-items: flex-end;
    }
}

/* ===== Dark mode ===== */

@media (prefers-color-scheme: dark) {
    body {
        background: #111;
    }

    .idea-hero-title {
        color: #f3f4f6;
    }

    .idea-search-toggle {
        color: #666;
    }

    .idea-search-toggle:hover {
        color: #aaa;
    }

    .idea-search {
        background: #1a1a1a;
        border-color: #333;
        color: #f3f4f6;
    }

    .idea-search:focus {
        border-color: #555;
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
    }

    .idea-search::placeholder {
        color: #666;
    }

    .idea-search-icon {
        color: #666;
    }

    .idea-card {
        background: #1a1a1a;
        border-color: #2a2a2a;
    }

    .idea-card:hover {
        border-color: #444;
        background: #222;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    }

    .idea-card-title {
        color: #f0f0f0;
    }

    .idea-card-desc {
        color: #999;
    }

    .idea-card-badge-category {
        background: #2a2a2a;
        color: #888;
    }

    .idea-card-star {
        color: #444;
    }

    .idea-card-rating-count {
        color: #666;
    }

    .idea-empty {
        color: #666;
    }

    .idea-footer {
        color: #666;
    }

    .idea-submit-link {
        color: #888;
    }

    .idea-submit-link:hover {
        color: #ddd;
    }

    .idea-modal-backdrop {
        background: rgba(0, 0, 0, 0.5);
    }

    .idea-modal-panel {
        background: #1a1a1a;
    }

    .idea-modal-close {
        color: #888;
    }

    .idea-modal-close:hover {
        color: #ddd;
    }

    .idea-modal-title {
        color: #f0f0f0;
    }

    .idea-modal-desc {
        color: #999;
    }

    .idea-modal-category {
        background: #2a2a2a;
        color: #888;
    }

    .idea-modal-prompt-label {
        color: #666;
    }

    .idea-modal-prompt {
        background: #222;
        border-color: #333;
        color: #ddd;
    }

    .idea-modal-prompt:focus {
        border-color: #555;
    }

    .idea-modal-image-tag {
        background: #222;
        border-color: #333;
        color: #ddd;
    }

    .idea-modal-star-btn {
        color: #444;
    }

    .idea-modal-star-btn.filled {
        color: #f59e0b;
    }

    .idea-modal-use-btn {
        background: #f3f4f6;
        color: #111;
    }

    .idea-modal-use-btn:hover {
        background: #d1d5db;
    }

    .idea-submit-input,
    .idea-submit-textarea {
        background: #222;
        border-color: #333;
        color: #ddd;
    }

    .idea-submit-input:focus,
    .idea-submit-textarea:focus {
        border-color: #555;
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
    }

    .idea-submit-label {
        color: #666;
    }

    .idea-footer button.idea-submit-link {
        color: #888;
    }

    .idea-footer button.idea-submit-link:hover {
        color: #ddd;
    }
}
