/* ── RESET & BASE ─────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #faf8f5;
    color: #1a1a2e;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* ── HEADER ───────────────────────────────────────────────── */
header {
    text-align: center;
    padding: 40px 0 20px;
    border-bottom: 1px solid #e8e4de;
    margin-bottom: 30px;
}

.logo {
    font-size: 56px;
    font-weight: 800;
    background: linear-gradient(135deg, #0d6e66, #c2185b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    display: inline-block;
}

.tagline {
    color: #1a1a2e;
    font-size: 24px;
    margin-top: 6px;
}

/* ── TABS ─────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    border-bottom: 1px solid #e8e4de;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 16px 28px;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-btn:hover { color: #0d6e66; }
.tab-btn.active { color: #0d6e66; border-bottom-color: #0d6e66; }

/* ── TAB CONTENT ──────────────────────────────────────────── */
.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }

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

/* ── INPUT SECTION ────────────────────────────────────────── */
.input-section {
    background: #ffffff;
    padding: 28px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid #e8e4de;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}

.input-group { margin-bottom: 14px; }

label {
    display: block;
    margin-bottom: 7px;
    color: #1a1a2e;
    font-size: 20px;
    font-weight: 600;
}

input[type="text"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    background: #faf8f5;
    border: 1px solid #e8e4de;
    border-radius: 10px;
    color: #1a1a2e;
    font-size: 20px;
    font-family: inherit;
    transition: all 0.25s ease;
}

input[type="text"]:focus,
input[type="url"]:focus,
textarea:focus {
    outline: none;
    border-color: #0d6e66;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13,110,102,0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
    font-family: 'Courier New', monospace;
    font-size: 19px;
}

select {
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* ── PLATFORM BADGE ───────────────────────────────────────── */
#platformBadge {
    display: none;
    background: linear-gradient(135deg, #0d6e66, #c2185b);
    color: #fff;
    padding: 7px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

button {
    padding: 16px 30px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
    background: linear-gradient(135deg, #0d6e66, #0a9b8e);
    color: #fff;
    flex: 1;
    min-width: 150px;
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(13,110,102,0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #c2185b, #e8734a);
    color: #fff;
    flex: 1;
    min-width: 150px;
}
.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(194,24,91,0.3);
}

.btn-tertiary {
    background: #f4f1eb;
    color: #1a1a2e;
    flex: 1;
    min-width: 150px;
    border: 1px solid #e8e4de;
}
.btn-tertiary:hover:not(:disabled) { background: #e8e4de; color: #1a1a2e; }

.copy-btn {
    background: #f4f1eb;
    color: #0d6e66;
    padding: 10px 18px;
    font-size: 14px;
    margin-top: 10px;
    width: auto;
    border: 1px solid #e8e4de;
}
.copy-btn:hover { background: #e8e4de; color: #0a9b8e; }

/* ── RESULT SECTIONS ──────────────────────────────────────── */
#resultsContainer,
#scriptResultsContainer,
#ideasResultsContainer,
#imgResultsContainer { margin-top: 20px; }

.result-section {
    background: #ffffff;
    padding: 22px;
    border-radius: 12px;
    margin-bottom: 14px;
    border: 1px solid #e8e4de;
    border-left: 4px solid #0d6e66;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}

.result-section h3 {
    color: #0d6e66;
    margin-bottom: 10px;
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.result-text {
    color: #1a1a2e;
    font-size: 20px;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 10px;
    background: #faf8f5;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid #e8e4de;
}

/* ── VIDEO EMBED ──────────────────────────────────────────── */
.video-embed-section {
    background: #ffffff;
    padding: 22px;
    border-radius: 12px;
    margin-bottom: 14px;
    border: 1px solid #e8e4de;
    border-left: 4px solid #c2185b;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}

.video-embed-section h3 {
    color: #c2185b;
    margin-bottom: 14px;
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.video-embed-wrapper {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.video-embed-wrapper iframe {
    width: 100%;
    border: none;
    border-radius: 12px;
}

.video-embed-fallback {
    text-align: center;
    padding: 40px 20px;
    background: #faf8f5;
    border-radius: 12px;
    border: 2px dashed #e8e4de;
}

.video-embed-fallback a {
    display: inline-block;
    margin-top: 12px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0d6e66, #0a9b8e);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.25s;
}

.video-embed-fallback a:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(13,110,102,0.3);
}

.embed-hint {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fef0f5;
    border-radius: 8px;
    font-size: 14px;
    color: #888;
    text-align: center;
}

/* ── CAROUSEL PREVIEW ─────────────────────────────────────── */
.carousel-preview {
    background: #ffffff;
    padding: 22px;
    border-radius: 12px;
    margin-bottom: 14px;
    border: 1px solid #e8e4de;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}

.carousel-preview h3 {
    color: #0d6e66;
    margin-bottom: 14px;
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.carousel-image-wrapper { display: inline-block; margin: 0 8px 8px 0; }

.carousel-image-wrapper img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    border: 2px solid #0d6e66;
    object-fit: cover;
}

/* ── LOADING ──────────────────────────────────────────────── */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #777;
    font-size: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50%       { opacity: 1; }
}

/* ── MESSAGES ─────────────────────────────────────────────── */
#errorMessage,
#scriptErrorMessage,
#ideasErrorMessage,
#imgErrorMessage {
    display: none;
    background: #fef0f5;
    color: #c2185b;
    padding: 13px 16px;
    border-radius: 8px;
    margin-bottom: 14px;
    border-left: 4px solid #c2185b;
    font-size: 17px;
}

/* ── ACTION BUTTONS WRAPPER ───────────────────────────────── */
#actionButtons { display: none; gap: 12px; flex-wrap: wrap; }

/* ── IMAGE PROMPTS: NICHE GRID ────────────────────────────── */
.niche-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.niche-card {
    background: #ffffff;
    border: 2px solid #e8e4de;
    border-radius: 14px;
    padding: 18px 12px;
    cursor: pointer;
    transition: all 0.25s;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.niche-card:hover {
    border-color: #c2185b;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(194,24,91,0.1);
}

.niche-card.selected {
    border-color: #c2185b;
    background: #fef0f5;
}

.niche-card .niche-icon {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.niche-card .niche-name {
    color: #1a1a2e;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ── IMAGE PROMPTS: EVENT PILLS ───────────────────────────── */
.event-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.event-pill {
    background: #faf8f5;
    border: 1px solid #e8e4de;
    padding: 7px 15px;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.event-pill:hover {
    border-color: #c2185b;
    color: #c2185b;
}

.event-pill.selected {
    background: #fef0f5;
    border-color: #c2185b;
    color: #c2185b;
    font-weight: 600;
}

/* ── FOOTER ───────────────────────────────────────────────── */
footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid #e8e4de;
    margin-top: 50px;
    color: #999;
    font-size: 17px;
}

footer a { color: #0d6e66; text-decoration: none; font-weight: 600; }
footer a:hover { color: #0a9b8e; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .container { padding: 14px; }
    header { padding: 28px 0 14px; }
    .logo { font-size: 30px; }
    .tabs { gap: 4px; }
    .tab-btn { padding: 12px 16px; font-size: 14px; }
    .input-section { padding: 18px; }
    .button-group { flex-direction: column; }
    button { width: 100%; }
    .carousel-image-wrapper img { max-width: 120px; max-height: 120px; }
    .niche-grid { grid-template-columns: repeat(2, 1fr); }
    .video-embed-wrapper { max-width: 100%; }
}

@media (max-width: 480px) {
    .container { padding: 10px; }
    .logo { font-size: 26px; }
    .tab-btn { padding: 10px 12px; font-size: 13px; }
    .input-section { padding: 14px; }
    textarea { min-height: 90px; }
    .result-text { font-size: 18px; padding: 12px; }
    .niche-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── ACCESSIBILITY: visible focus rings for keyboard nav ── */
button:focus-visible,
.niche-card:focus-visible,
.event-pill:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid #0a9b8e;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(10, 155, 142, 0.2);
}

/* Niche card "selected" non-color cue: visible checkmark in corner */
.niche-card { position: relative; }
.niche-card.selected::after {
    content: '\2713';
    position: absolute;
    top: 6px;
    right: 8px;
    width: 22px;
    height: 22px;
    background: #0d6e66;
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

/* Event pill "selected" non-color cue */
.event-pill.selected {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
}

/* Reset native button styling on cards/pills since they're styled like cards */
button.niche-card,
button.event-pill {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    cursor: pointer;
    background: inherit;
    color: inherit;
    border: inherit;
}
