/* style.css — Brand Voice Frontend */
/* adautomate_voice | voice.adautomate.online */

:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --border: #2a2d3a;
    --text: #e1e4ed;
    --text-muted: #8b8fa3;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 10px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo { font-size: 1.3em; font-weight: 700; }
.logo span { color: var(--text-muted); font-weight: 400; font-size: 0.85em; }

nav { display: flex; gap: 4px; flex-wrap: wrap; }

.tab {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}
.tab:hover { background: var(--border); color: var(--text); }
.tab.active { background: var(--accent); color: white; border-color: var(--accent); }

main { max-width: 900px; margin: 0 auto; padding: 32px 24px; }
.tab-content { display: none; }
.tab-content.active { display: block; }

h2 { font-size: 1.6em; margin-bottom: 4px; }
h3 { font-size: 1.2em; margin: 24px 0 12px; }
h4 { font-size: 1em; margin: 16px 0 8px; color: var(--text-muted); }
.subtitle { color: var(--text-muted); margin-bottom: 24px; }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9em; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95em;
    font-family: inherit;
    resize: vertical;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.form-row { display: flex; gap: 16px; }
.form-group.half { flex: 1; }

/* SAMPLE BLOCKS */
.sample-block {
    margin-bottom: 12px;
    position: relative;
}
.sample-block label {
    display: block;
    font-size: 0.85em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.char-count {
    position: absolute;
    bottom: 8px;
    right: 10px;
    font-size: 0.75em;
    color: var(--text-muted);
}
.sample-actions { display: flex; gap: 8px; margin-bottom: 16px; }

/* BUTTONS */
.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-danger:hover:not(:disabled) {
    background: var(--danger);
    color: white;
}
.btn-danger:disabled { opacity: 0.3; cursor: not-allowed; }

/* STATUS */
.status {
    margin: 16px 0;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 0.9em;
}
.status.loading { background: rgba(99,102,241,0.15); color: var(--accent); }
.status.error { background: rgba(239,68,68,0.15); color: var(--danger); }
.status.success { background: rgba(34,197,94,0.15); color: var(--success); }
.hidden { display: none !important; }

/* RESULTS */
.results {
    margin-top: 24px;
    padding: 20px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.profile-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.profile-row { padding: 8px 0; border-bottom: 1px solid var(--border); }
.profile-row:last-child { border: none; }
.badge {
    background: var(--accent);
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    text-transform: capitalize;
}
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag {
    background: var(--border);
    color: var(--text);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
}
.tag.persuasion { background: rgba(99,102,241,0.2); color: var(--accent-hover); }
.tag.emotion { background: rgba(245,158,11,0.2); color: var(--warning); }
.tag.phrase { background: rgba(34,197,94,0.2); color: var(--success); }

.style-guide-box {
    background: rgba(99,102,241,0.08);
    border-left: 3px solid var(--accent);
    padding: 12px 16px;
    border-radius: 4px;
    margin: 16px 0;
}
.style-guide-box p { font-size: 0.95em; line-height: 1.6; }

.status-text { margin-left: 12px; font-size: 0.9em; }

/* GENERATE OUTPUT */
.gen-block { margin-bottom: 16px; }
.gen-block label { display: block; font-size: 0.85em; color: var(--text-muted); margin-bottom: 4px; }
.gen-output {
    background: var(--bg);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.95em;
    line-height: 1.5;
    min-height: 32px;
    white-space: pre-wrap;
}

.voice-match { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.voice-match label { font-size: 0.9em; color: var(--text-muted); }
.score-bar {
    flex: 1;
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
}
.score-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 5px;
    transition: width 0.5s ease;
    width: 0%;
}
#score-value { font-weight: 700; font-size: 1em; }
.voice-notes {
    font-size: 0.9em;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-style: italic;
}
.gen-actions { display: flex; gap: 8px; }

/* PERSONA CARDS */
.persona-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.persona-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.persona-card:hover { border-color: var(--accent); }
.persona-card.selected { border-color: var(--accent); background: rgba(99,102,241,0.08); }
.persona-avatar { font-size: 2em; }
.persona-info h4 { margin: 0 0 4px; color: var(--text); }
.persona-info p { font-size: 0.8em; color: var(--text-muted); margin: 0; }
.persona-traits { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.persona-trait {
    background: var(--border);
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--text-muted);
}

.feedback-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 16px; }
.feedback-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}
.feedback-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.feedback-rating { font-size: 1.4em; font-weight: 700; color: var(--accent); }
.feedback-comment { font-size: 0.9em; line-height: 1.5; margin-bottom: 8px; }
.feedback-meta { display: flex; gap: 12px; font-size: 0.85em; color: var(--text-muted); }

.consensus-box, .suggestions-box {
    background: var(--bg);
    padding: 14px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    border: 1px solid var(--border);
}
.consensus-box ul, .suggestions-box ul { list-style: inside; }
.consensus-box li, .suggestions-box li { margin: 6px 0; font-size: 0.9em; line-height: 1.5; }

/* LIBRARY */
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.library-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.library-card:hover { border-color: var(--accent); }
.library-card h4 { margin: 0 0 4px; color: var(--text); }
.library-card .meta { font-size: 0.85em; color: var(--text-muted); }
.library-card .actions { display: flex; gap: 8px; margin-top: 12px; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--text-muted); }

/* MODAL */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}
.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}
.modal-close {
    position: absolute;
    top: 12px; right: 16px;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--text-muted);
}

.hint { display: block; font-size: 0.85em; color: var(--text-muted); margin-top: 4px; }
.hint a { color: var(--accent); text-decoration: none; }
.hint a:hover { text-decoration: underline; }

footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.85em;
    border-top: 1px solid var(--border);
    margin-top: 32px;
}
footer a { color: var(--accent); text-decoration: none; }
