/* style.css */
/* Qualitative Design Advisor */

* { box-sizing: border-box; }

body {
    margin: 0; min-height: 100vh;
    font-family: Inter, system-ui, -apple-system, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg-gradient);
    transition: background 0.3s ease, color 0.3s ease;
}

button, input, textarea, select { font: inherit; }
button { border: 0; }
a { color: inherit; text-decoration: none; }

.app-shell { width: min(1440px, 100%); margin: 0 auto; padding: 24px; }

.hero {
    position: relative; overflow: hidden; border-radius: 28px; padding: 32px;
    color: #ffffff; background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.12);
}

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 40px; }
.brand { display: flex; align-items: center; gap: 14px; }

.brand-mark {
    display: grid; place-items: center; width: 52px; height: 52px;
    border-radius: 18px; color: var(--primary); background: white;
    font-weight: 900; letter-spacing: -0.03em; box-shadow: 0 14px 35px rgba(0, 0, 0, 0.18);
}

.brand-title { font-size: 1.35rem; font-weight: 850; }
.brand-subtitle { font-size: 0.92rem; opacity: 0.85; }

.theme-selector {
    background: rgba(255,255,255,0.2); color: white;
    border: 1px solid rgba(255,255,255,0.4); border-radius: 8px;
    padding: 8px 12px; outline: none; cursor: pointer;
}
.theme-selector option { color: #000; }

.guide-link, .ghost-button, .secondary-button, .primary-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 44px; padding: 0 18px; border-radius: 999px; cursor: pointer; font-weight: 750;
    transition: all 0.18s ease;
}

.guide-link { color: white; border: 1px solid rgba(255, 255, 255, 0.32); background: rgba(255, 255, 255, 0.15); }
.guide-link:hover, .ghost-button:hover, .secondary-button:hover, .primary-button:hover { transform: translateY(-2px); }

.hero-grid { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 24px; align-items: end; }

.eyebrow {
    margin: 0 0 10px; color: var(--accent-2); font-size: 0.8rem; font-weight: 850;
    letter-spacing: 0.12em; text-transform: uppercase;
}

.hero h1 { max-width: 850px; margin: 0; font-size: clamp(2rem, 5vw, 3.8rem); line-height: 1; letter-spacing: -0.05em; }
.hero-text { margin: 20px 0 0; font-size: 1.15rem; line-height: 1.6; opacity: 0.9;}

.profile-card {
    padding: 24px; border-radius: 24px; background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.profile-label { color: var(--accent-2); font-size: 0.75rem; font-weight: 850; text-transform: uppercase; }
.profile-name { margin-top: 10px; font-size: 1.35rem; font-weight: 850; }

.main-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 24px; margin-top: 24px; }

.panel {
    border: 1px solid var(--line); border-radius: 24px; background: var(--card);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.05); padding: 28px;
}

.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.panel-header h2 { margin: 0; font-size: 1.6rem; color: var(--primary); }

.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; color: var(--ink); font-weight: 700; }
small { display: block; margin-top: 6px; color: var(--muted); font-size: 0.85rem; line-height: 1.4; }

input, textarea, select {
    width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
    color: var(--ink); background: transparent; outline: none; transition: border-color 0.2s;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.5; font-size: 1rem; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05); }

.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.primary-button { color: white; background: var(--primary); min-width: 220px; }
.secondary-button { color: var(--primary); background: transparent; border: 1px solid var(--primary); }
.ghost-button { color: var(--primary); background: transparent; border: 1px solid var(--line); }
button:disabled { cursor: not-allowed; opacity: 0.6; transform: none !important; }

.button-spinner {
    display: none; width: 18px; height: 18px; border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3); border-top-color: white; animation: spin 0.8s linear infinite;
}
.primary-button.is-loading .button-spinner { display: inline-block; }
.large-spinner {
    width: 50px; height: 50px; border-radius: 50%; border: 4px solid var(--line);
    border-top-color: var(--primary); animation: spin 0.8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-box {
    margin-bottom: 20px; padding: 14px 18px; border-radius: 12px;
    border: 1px solid var(--line); color: var(--primary); font-weight: 500; background: rgba(0,0,0,0.02);
}

.result {
    min-height: 600px; max-height: 75vh; overflow-y: auto; padding: 24px;
    border-radius: 16px; background: transparent; border: 1px solid var(--line);
}
.result h2 { margin: 24px 0 12px; color: var(--primary); font-size: 1.4rem; border-bottom: 2px solid var(--line); padding-bottom: 8px;}
.result h3 { color: var(--ink); margin-top: 18px;}
.result p, .result li { line-height: 1.7; font-size: 1rem; }
.result em { color: var(--ink); font-style: italic; }
.result strong { color: var(--primary-2); }

/* Table Styles */
.result table {
    width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.95rem;
    border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1px var(--line);
}
.result th, .result td { padding: 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.result th { background: var(--primary); color: white; font-weight: 600; line-height: 1.4; }
.result tr:nth-child(even) td { background: rgba(0,0,0,0.02); }

/* Methodological Warning Highlight */
.method-warning {
    background: #fff3e0; border-left: 5px solid #ff9800; padding: 18px;
    margin: 20px 0; border-radius: 0 8px 8px 0;
}
.method-warning h3 { color: #e65100; margin-top: 0; display: flex; align-items: center; gap: 8px;}

.empty-state, .loading-state, .error-state { display: grid; place-items: center; text-align: center; height: 100%; }
.empty-icon { font-size: 3.5rem; margin-bottom: 16px; }

@media (max-width: 900px) {
    .hero-grid, .main-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.2rem; }
    .result table { display: block; overflow-x: auto; white-space: nowrap; }
}
