@import url('../style.css');

:root {
    --theme-surface: rgba(255, 255, 255, 0.28);
    --theme-border: rgba(29, 69, 51, 0.3);
    --theme-soft: #fbe6d8;
}

body {
    background: var(--cream);
}

.themes-page {
    padding: 54px 7% 72px;
}

.page-intro {
    max-width: 760px;
    margin: 0 auto 36px;
    text-align: center;
}

.eyebrow {
    margin-bottom: 10px;
    color: var(--forest);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.page-intro h1 {
    margin-bottom: 12px;
    color: var(--forest);
    font-size: clamp(36px, 4vw, 56px);
    line-height: 1.1;
}

.intro-copy {
    color: var(--brown);
    font-size: 16px;
    line-height: 1.7;
}

.themes-section {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 20px;
}

.section-header h2 {
    color: var(--forest);
    font-size: 28px;
    font-weight: 700;
}

.themes-toolbar {
    margin-bottom: 28px;
}

.theme-search {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(100%, 420px);
    padding: 14px 18px;
    background: var(--cream);
    border: 2px solid var(--forest);
    border-radius: 999px;
    box-shadow: 0 5px 0 rgba(29, 69, 51, 0.15);
}

.theme-search i {
    color: var(--forest);
    font-size: 16px;
}

.theme-search input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--brown);
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
}

.theme-search input::placeholder {
    color: rgba(94, 49, 34, 0.7);
}

.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 24px;
    align-items: stretch;
    min-height: 260px;
    padding-bottom: 8px;
}

.themes-empty {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 210px;
    padding: 28px;
    border: 2px dashed var(--theme-border);
    border-radius: 18px;
    background: var(--theme-surface);
    color: var(--brown);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

.theme-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 150px;
    padding: 22px 20px;
    background: var(--cream);
    border: 2px solid var(--forest);
    border-radius: 16px;
    box-shadow: 5px 5px 0 var(--brown);
}

.theme-card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin-top: auto;
    padding: 10px 16px;
    border: 2px solid var(--forest);
    border-radius: 999px;
    background: var(--forest);
    color: var(--cream);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s ease;
}

.theme-card-link:hover {
    background: var(--brown);
    transform: translateY(-1px);
}

.theme-card-body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.theme-card-body h3 {
    margin-bottom: 10px;
    color: var(--forest);
    font-size: 22px;
    line-height: 1.2;
}

.theme-card-body p {
    color: var(--brown);
    font-size: 14px;
    line-height: 1.6;
}


.theme-detail-page {
    padding: 54px 7% 70px;
}

.theme-detail-card {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 28px;
    background: rgba(255, 255, 255, 0.14);
    border: 2px solid var(--forest);
    border-radius: 24px;
    box-shadow: 6px 6px 0 rgba(29, 69, 51, 0.12);
}

.back-link {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--forest);
    font-weight: 600;
    text-decoration: none;
}

.detail-label {
    margin-bottom: 10px;
    color: var(--forest);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.theme-detail-card h1 {
    margin-bottom: 12px;
    color: var(--forest);
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1.1;
}

.theme-detail-card p {
    color: var(--brown);
    line-height: 1.7;
}

.generate-form {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.input-group {
    display: grid;
    gap: 8px;
    color: var(--forest);
    font-weight: 600;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--forest);
    border-radius: 14px;
    background: var(--cream);
    color: var(--brown);
    font: inherit;
}

.primary-btn,
.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 14px 22px;
    border: 2px solid var(--forest);
    border-radius: 999px;
    background: var(--forest);
    color: var(--cream);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: 0.2s ease;
}

.primary-btn:hover,
.download-btn:hover {
    background: var(--brown);
    transform: translateY(-1px);
}

.result-box {
    display: none;
    margin-top: 28px;
    padding: 22px 18px;
    border: 2px solid var(--forest);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
}

.result-box.visible {
    display: block;
}

.generated-image {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    border-radius: 16px;
    border: 2px solid var(--forest);
    background: #fff;
}

.result-actions {
    margin-top: 16px;
}

.status-message {
    min-height: 24px;
    margin-top: 14px;
    color: var(--brown);
    font-weight: 600;
}

@media (max-width: 700px) {
    .themes-page {
        padding: 42px 7% 55px;
    }

    .page-intro {
        margin-bottom: 26px;
    }

    .section-header h2 {
        font-size: 24px;
    }

    .theme-search {
        width: 100%;
    }

    .themes-grid {
        gap: 16px;
    }

    .theme-card {
        min-height: 200px;
    }

    .theme-detail-page {
        padding: 38px 7% 52px;
    }

    .theme-detail-card {
        padding: 24px 18px;
    }
}