/* ============================================================
   Genre Generator CSS — Consolidated RPGAnywhere Site
   Shared structural + light-theme styles for all generator,
   reference, and tool pages inside genre subdirectories.
   Loaded via header.php so every vault page gets it.
   ============================================================ */

/* === PAGE WRAPPER === */
.generator-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem 2rem;
}

/* === PAGE HEADER === */
.generator-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.generator-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    margin: 0 0 0.5rem;
}

.generator-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto;
}

/* === FILTER / CONTROL SECTION === */
.filter-section,
.generator-controls {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.filter-section h3,
.generator-controls h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent);
    margin: 0 0 1rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.filter-group,
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.filter-group label,
.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: var(--font-primary);
    transition: border-color 0.15s;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px oklch(44% 0.10 199 / 0.15);
}

/* === GENERATE BUTTON === */
.generate-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: background 0.15s, transform 0.1s;
}

.generate-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

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

/* === LOADING STATE === */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.loading p {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* === STATUS BOXES === */
.error-message,
.error-box {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-left: 4px solid var(--danger);
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    color: #7f1d1d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.loading-box {
    background: oklch(42% 0.13 194 / 0.06);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

.success-box {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    border-left: 4px solid var(--success);
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    color: #166534;
    font-size: 0.9rem;
}

/* === RESULTS === */
.results-section {
    margin-top: 1.5rem;
}

.result-card,
.survivor-card,
.npc-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.result-header {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.result-header h2,
.survivor-name,
.npc-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin: 0 0 0.25rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

/* === INFO SECTIONS === */
.info-section {
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
}

.info-section h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-light);
    margin: 0 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}

.info-section.full-width {
    grid-column: 1 / -1;
}

.info-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.info-item strong {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.info-item span,
.info-item p {
    color: var(--text-primary);
    margin: 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.info-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}

/* === TEXT VARIANTS === */
.description-text,
.description-box {
    background: var(--bg-darker);
    border-left: 3px solid var(--primary-light);
    border-radius: 0 0.4rem 0.4rem 0;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin: 0.5rem 0;
    font-style: italic;
}

.quote-box {
    background: oklch(42% 0.13 194 / 0.06);
    border-left: 3px solid var(--accent);
    border-radius: 0 0.4rem 0.4rem 0;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    font-style: italic;
    margin: 0.5rem 0;
}

.highlight,
.highlight-text {
    color: var(--primary-light);
    font-weight: 600;
}

.curse-text {
    color: #b91c1c;
    font-style: italic;
}

/* === THEMATIC SECTIONS === */
.supernatural-section,
.warning-section,
.danger-section,
.dangerous-section {
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 0.75rem;
}

.supernatural-section h3 { color: var(--accent); }
.warning-section h3      { color: #b45309; }
.danger-section h3,
.dangerous-section h3    { color: #b91c1c; }

.warning {
    background: #fef9c3;
    border: 1px solid #fde68a;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    color: #713f12;
    font-size: 0.85rem;
}

/* === LISTS === */
.abilities-list,
.weakness-list,
.resistance-list,
.signs-list,
.warning-list,
.location-list,
.npc-list,
.trait-list,
.skills-grid {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.abilities-list li,
.weakness-list li,
.resistance-list li,
.signs-list li,
.warning-list li,
.location-list li,
.npc-list li,
.trait-list li,
.skills-grid li {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
}

.weakness-list li  { border-left: 2px solid #dc2626; }
.warning-list li   { border-left: 2px solid #d97706; }
.abilities-list li { border-left: 2px solid var(--primary-light); }

/* === ACTION BUTTONS === */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.action-buttons .generate-btn {
    flex: 1;
    min-width: 160px;
}

.print-btn {
    padding: 0.625rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: border-color 0.15s, color 0.15s;
}

.print-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary-light);
}

/* === LAUNCH CARD (external tool pages) === */
.launch-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.launch-icon {
    font-size: 5rem;
    display: block;
    margin-bottom: 1rem;
    line-height: 1;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

.launch-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin: 0 0 0.5rem;
}

.launch-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.launch-button {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--primary);
    color: #fff;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
}

.launch-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    text-decoration: none;
    color: #fff;
}

/* === EXTERNAL TOOL NOTICE === */
.external-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    background: oklch(42% 0.13 194 / 0.06);
    border: 1px solid oklch(42% 0.13 194 / 0.25);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.external-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
}

/* === EMBEDDED IFRAME === */
.iframe-container {
    position: relative;
    width: 100%;
    height: 80vh;
    min-height: 650px;
    overflow: hidden;
    border-radius: 0 0 0.75rem 0.75rem;
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* === MOBILE === */
@media (max-width: 768px) {
    .generator-container { padding: 1rem; }
    .result-grid         { grid-template-columns: 1fr; }
    .filter-grid         { grid-template-columns: 1fr; }
    .action-buttons      { flex-direction: column; }
    .action-buttons .generate-btn { min-width: unset; }
    .iframe-container    { height: 70vh; min-height: 500px; }
}
