@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

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

/* ─── Base ─── */
body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #3d3d3d;
    background: #f4f4f2;
    min-height: 100vh;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 880px;
    margin: 0 auto;
    background: #fff;
}

/* ─── Header ─── */
header {
    background: #fff;
    color: #111;
    padding: 80px 56px 72px;
    text-align: center;
    border-bottom: 1px solid #eaeaea;
}

header h1 {
    font-size: 3em;
    font-weight: 800;
    color: #111;
    margin-bottom: 12px;
    letter-spacing: -0.035em;
    line-height: 1.05;
}

.tagline {
    font-size: 1.2em;
    font-weight: 400;
    color: #666;
    letter-spacing: -0.005em;
    line-height: 1.5;
}

.header-cta {
    margin-top: 40px;
}

/* ─── Main Content ─── */
main {
    padding: 64px 56px 72px;
}

section {
    margin-bottom: 64px;
}

section:last-child {
    margin-bottom: 0;
}

/* ─── Headings ─── */
h2 {
    font-size: 1.55em;
    font-weight: 700;
    margin-bottom: 24px;
    color: #111;
    letter-spacing: -0.025em;
    line-height: 1.2;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 32px;
    height: 2.5px;
    background: #2a9d8f;
    border-radius: 2px;
}

h3 {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 10px;
    color: #222;
    line-height: 1.35;
}

/* ─── Prose ─── */
.intro p,
.about p {
    font-size: 1.1em;
    line-height: 1.8;
    color: #444;
    margin-bottom: 20px;
    max-width: 640px;
    letter-spacing: -0.005em;
}

.intro p:last-child,
.about p:last-child {
    margin-bottom: 0;
}

.intro strong {
    color: #111;
    font-weight: 600;
}

/* ─── CTA Section ─── */
.cta-section {
    background: #f9f9f7;
    padding: 64px 48px;
    text-align: center;
    border-radius: 10px;
    margin: 64px 0;
    border: 1px solid #eaeaea;
}

.cta-section::before {
    display: none;
}

.cta-section h2 {
    color: #111;
    font-size: 1.8em;
    margin-bottom: 14px;
    display: block;
}

.cta-section h2::after {
    display: none;
}

.cta-text {
    color: #555;
    font-size: 1.1em;
    line-height: 1.7;
    margin-bottom: 36px;
    font-weight: 400;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.button-wrapper {
    margin: 32px 0;
}

.big-button {
    display: inline-block;
    background: #2a9d8f;
    color: #fff !important;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.15em;
    font-weight: 700;
    padding: 18px 44px;
    border-radius: 8px;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(42, 157, 143, 0.25);
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
    border: none;
}

.big-button:hover {
    background: #238b7e;
    box-shadow: 0 4px 16px rgba(42, 157, 143, 0.3);
    transform: translateY(-1px);
}

.big-button:active {
    transform: translateY(0);
}

.hint {
    color: #888;
    font-size: 0.9em;
    margin-top: 20px;
    font-weight: 400;
    line-height: 1.5;
}

/* ─── How It Works ─── */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 32px;
}

.step {
    background: #f9f9f7;
    padding: 32px 28px;
    border-radius: 10px;
    border: 1px solid #eaeaea;
    transition: all 0.2s ease;
    position: relative;
}

.step::before {
    display: none;
}

.step:hover {
    border-color: #d4d4d0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.step h3 {
    color: #2a9d8f;
    margin-bottom: 12px;
}

.step p {
    color: #555;
    line-height: 1.7;
    font-size: 0.95em;
}

/* ─── Ideas List ─── */
.examples {
    background: #f9f9f7;
    padding: 40px;
    border-radius: 10px;
    margin: 56px 0;
    border: 1px solid #eaeaea;
}

.ideas-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 28px;
}

.ideas-list li {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    transition: all 0.15s ease;
    font-size: 0.95em;
    line-height: 1.55;
    color: #444;
    border: 1px solid #eaeaea;
    border-left: 3px solid #2a9d8f;
}

.ideas-list li:hover {
    border-left-color: #40b5a6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ideas-list li::before {
    content: none;
}

/* ─── Warning ─── */
.warning {
    background: #fffbf0;
    padding: 40px 44px;
    border-radius: 10px;
    margin: 56px 0;
    border: 1px solid #f0e5c9;
}

.warning h2 {
    color: #946b2d;
    margin-bottom: 20px;
    display: block;
}

.warning h2::after {
    background: #c89545;
}

.warning p {
    font-size: 1.05em;
    line-height: 1.8;
    color: #6b5530;
    margin-bottom: 16px;
    max-width: 640px;
}

.warning p:last-child {
    margin-bottom: 0;
}

/* ─── About ─── */
.about p {
    color: #444;
}

/* ─── Inline Code ─── */
code {
    background: #f3f3f1;
    padding: 2px 7px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    color: #2a9d8f;
    font-size: 0.875em;
    font-weight: 500;
}

/* ─── Footer ─── */
footer {
    background: #f9f9f7;
    color: #888;
    text-align: center;
    padding: 40px 32px;
    font-size: 0.9em;
    line-height: 1.7;
    border-top: 1px solid #eaeaea;
}

footer p {
    margin: 5px 0;
}

.footer-powered {
    font-size: 0.95em;
    margin: 8px 0;
    color: #666;
}

.footer-powered a {
    color: #2a9d8f;
    text-decoration: none;
    transition: color 0.15s ease;
    font-weight: 600;
}

.footer-powered a:hover {
    color: #238b7e;
}

.footer-link {
    margin-top: 8px;
}

.footer-link a {
    color: #2a9d8f;
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-link a:hover {
    color: #238b7e;
    text-decoration: underline;
}

/* ─── Chat List ─── */
.chat-list {
    display: grid;
    gap: 16px;
}

.chat-item {
    background: #f9f9f7;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.15s ease;
    border: 1px solid #eaeaea;
}

.chat-item:hover {
    border-color: #d4d4d0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chat-item a {
    display: block;
    padding: 20px 24px;
    text-decoration: none;
    color: inherit;
}

.chat-item h3 {
    color: #111;
    margin-bottom: 8px;
}

.chat-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9em;
    color: #888;
}

.message-count {
    font-weight: 600;
    color: #2a9d8f;
}

.url-example {
    background: #222;
    padding: 20px 24px;
    border-radius: 8px;
    margin: 20px 0;
}

.url-example code {
    background: transparent;
    color: #5eead4;
    font-size: 1em;
}

.note {
    background: #fffbf0;
    border-left: 3px solid #c89545;
    padding: 18px 22px;
    border-radius: 8px;
    color: #6b5530;
    font-size: 0.95em;
    line-height: 1.65;
}

/* ─── Chat Viewer ─── */
.chat-header {
    background: #fff;
    color: #111;
    padding: 48px 40px;
    border-bottom: 1px solid #eaeaea;
}

.chat-header h1 {
    font-size: 1.7em;
    margin-bottom: 10px;
    font-weight: 700;
    line-height: 1.2;
    color: #111;
}

.chat-info {
    display: flex;
    gap: 20px;
    font-size: 0.9em;
    color: #888;
    font-weight: 400;
}

.back-link {
    display: inline-block;
    color: #2a9d8f;
    text-decoration: none;
    margin-top: 20px;
    padding: 8px 16px;
    background: #f4f4f2;
    border-radius: 6px;
    transition: background 0.15s ease;
    font-size: 0.9em;
    font-weight: 500;
}

.back-link:hover {
    background: #eaeaea;
}

/* ─── Messages ─── */
.messages-container {
    padding: 40px 32px;
    max-width: 760px;
    margin: 0 auto;
}

.message {
    margin-bottom: 24px;
    padding: 24px;
    border-radius: 8px;
    border-left: 3px solid #eaeaea;
}

.message:hover {
    box-shadow: none;
}

.message.user {
    background: #f4faf9;
    border-left-color: #2a9d8f;
}

.message.assistant {
    background: #f8f5ff;
    border-left-color: #7c6dc7;
}

.message.system {
    background: #f9f9f7;
    border-left-color: #bbb;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.8em;
}

.message-type {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.8em;
}

.message.user .message-type { color: #2a9d8f; }
.message.assistant .message-type { color: #7c6dc7; }
.message.system .message-type { color: #aaa; }

.message-time {
    color: #aaa;
    font-size: 0.9em;
}

.message-content {
    line-height: 1.75;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #444;
    font-size: 0.95em;
}

/* ─── Message Form ─── */
.message-form {
    background: #f9f9f7;
    padding: 40px 32px;
    border-top: 1px solid #eaeaea;
}

.form-container {
    max-width: 760px;
    margin: 0 auto;
}

.message-form h2 {
    display: block;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 0.95em;
}

.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95em;
    line-height: 1.55;
    transition: all 0.15s ease;
    background: #fff;
    color: #333;
}

.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2a9d8f;
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.08);
}

.form-group textarea {
    min-height: 130px;
    resize: vertical;
}

.submit-btn {
    background: #2a9d8f;
    color: white;
    padding: 13px 36px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.submit-btn:hover {
    background: #238b7e;
}

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

/* ─── Alerts ─── */
.alert {
    padding: 16px 22px;
    border-radius: 8px;
    margin: 16px 24px;
    font-weight: 500;
    font-size: 0.95em;
    line-height: 1.55;
}

.alert.success {
    background: #f0faf5;
    color: #1a6b4a;
    border: 1px solid #c8e6d9;
}

.alert.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    header {
        padding: 56px 28px 48px;
    }

    header h1 {
        font-size: 2.2em;
    }

    main {
        padding: 44px 28px 52px;
    }

    section {
        margin-bottom: 48px;
    }

    .steps {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .step {
        padding: 26px 24px;
    }

    .chat-meta, .chat-info {
        flex-direction: column;
        gap: 4px;
    }

    .big-button {
        font-size: 1.05em;
        padding: 16px 32px;
    }

    .cta-section {
        padding: 48px 28px;
        margin: 48px 0;
    }

    .cta-section h2 {
        font-size: 1.5em;
    }

    .ideas-list {
        grid-template-columns: 1fr;
    }

    .examples {
        padding: 28px 24px;
    }

    .warning {
        padding: 28px 24px;
    }

    .intro p,
    .about p,
    .warning p {
        font-size: 1.02em;
    }
}

/* ═══════════════════════════════════════
   Art Exchange Gallery
   ═══════════════════════════════════════ */

/* ─── Gallery Nav ─── */
.gallery-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.gallery-nav a {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    color: #555;
    background: #f4f4f2;
    transition: all 0.15s ease;
}

.gallery-nav a:hover {
    background: #eaeaea;
    color: #111;
}

.gallery-nav a.active {
    background: #2a9d8f;
    color: #fff;
}

/* ─── Gallery Grid ─── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.gallery-item {
    background: #f9f9f7;
    border-radius: 8px;
    border: 1px solid #eaeaea;
    overflow: hidden;
    transition: all 0.15s ease;
}

.gallery-item:hover {
    border-color: #d4d4d0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.gallery-item a {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

.gallery-item-info {
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border-top: 1px solid #eaeaea;
}

.gallery-item-name {
    font-size: 0.8em;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.gallery-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #f4f4f2;
    color: #555;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 700;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.gallery-download:hover {
    background: #2a9d8f;
    color: #fff;
}

/* ─── Gallery Empty State ─── */
.gallery-empty {
    text-align: center;
    padding: 80px 28px;
    color: #888;
}

.gallery-empty p {
    font-size: 1.1em;
    margin-bottom: 24px;
}

/* ─── Gallery Stats ─── */
.gallery-stats {
    text-align: center;
    font-size: 0.85em;
    color: #999;
    margin-top: 24px;
    padding-bottom: 8px;
}

/* ─── Pagination ─── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    text-decoration: none;
    color: #555;
    background: #f4f4f2;
    border: 1px solid #eaeaea;
    transition: all 0.15s ease;
}

.pagination-link:hover {
    background: #eaeaea;
    color: #111;
}

.pagination-link.current {
    background: #2a9d8f;
    color: #fff;
    border-color: #2a9d8f;
}

.pagination-link.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.pagination-ellipsis {
    color: #aaa;
    padding: 0 4px;
}

/* ─── Upload Section ─── */
.upload-section {
    max-width: 560px;
    margin: 0 auto;
}

.upload-section h2 {
    margin-bottom: 28px;
}

/* ─── Drop Zone ─── */
.drop-zone {
    position: relative;
    border: 2px dashed #d4d4d0;
    border-radius: 10px;
    padding: 48px 28px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafaf8;
}

.drop-zone:hover,
.drop-zone-active {
    border-color: #2a9d8f;
    background: #f0faf8;
}

.drop-zone-has-file {
    border-color: #2a9d8f;
    border-style: solid;
    background: #f0faf8;
}

.drop-zone-icon {
    font-size: 2.5em;
    color: #bbb;
    line-height: 1;
    margin-bottom: 12px;
    font-weight: 300;
}

.drop-zone:hover .drop-zone-icon,
.drop-zone-active .drop-zone-icon {
    color: #2a9d8f;
}

.drop-zone-text {
    font-size: 1em;
    color: #555;
    margin-bottom: 8px;
}

.drop-zone-hint {
    font-size: 0.85em;
    color: #999;
}

.drop-zone-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* ─── File Info ─── */
.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-top: 12px;
    background: #f4f4f2;
    border-radius: 8px;
    font-size: 0.9em;
    color: #444;
}

#fileName {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

#fileSize {
    color: #888;
    flex-shrink: 0;
    margin-left: 12px;
}

/* ─── Upload Button ─── */
.upload-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
}

/* ─── Buttons ─── */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95em;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    text-align: center;
}

.btn-primary {
    background: #2a9d8f;
    color: #fff;
}

.btn-primary:hover {
    background: #238b7e;
}

.btn-primary:disabled {
    background: #b8d8d3;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f4f4f2;
    color: #555;
    border: 1px solid #eaeaea;
}

.btn-secondary:hover {
    background: #eaeaea;
    color: #111;
}

/* ─── Upload Preview ─── */
.upload-preview {
    margin: 24px 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #eaeaea;
}

.upload-preview img {
    display: block;
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    background: #f4f4f2;
}

.upload-preview-actions {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    background: #f9f9f7;
    border-top: 1px solid #eaeaea;
}

/* ─── Gallery Responsive ─── */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .gallery-nav {
        gap: 6px;
        margin-bottom: 24px;
    }

    .gallery-nav a {
        padding: 6px 14px;
        font-size: 0.85em;
    }

    .drop-zone {
        padding: 36px 20px;
    }

    .upload-preview-actions {
        flex-wrap: wrap;
    }

    .upload-preview-actions .btn {
        flex: 1;
        min-width: 100px;
    }

    .pagination {
        gap: 4px;
    }

    .pagination-link {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 0.85em;
    }
}
