/* style.css */
:root {
    --primary: #4285F4; /* Google Blue */
    --secondary: #DB4437; /* Google Red */
    --accent: #0F9D58; /* Google Green */
    --tertiary: #F4B400; /* Google Yellow */
    --purple: #AB47BC;  /* Futurist Purple */
    
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    
    --text-dark: #1f2937;
    --text-light: #6b7280;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    padding: 40px 20px;
    color: var(--text-dark);
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

/* Header */
header {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    padding: 30px 40px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.brand h1 {
    font-weight: 800;
    font-size: 28px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--tertiary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 5px;
}

.brand .subtitle { font-weight: 600; display: block; margin-bottom: 8px; }
.brand .description { color: var(--text-light); font-size: 14px; max-width: 650px; line-height: 1.5; }

/* Header Controls & Status */
.header-controls { display: flex; align-items: center; gap: 15px; margin-top: 10px;}

.api-status {
    display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
    background: rgba(255,255,255,0.5); padding: 8px 16px; border-radius: 20px; white-space: nowrap;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #ccc; }
.status-dot.active { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.status-dot.error { background: var(--secondary); }

.icon-btn {
    background: rgba(255, 255, 255, 0.5); border: none; width: 36px; height: 36px;
    border-radius: 50%; cursor: pointer; transition: all 0.2s; color: var(--text-dark);
    display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: white; transform: rotate(90deg); }

/* Grid & Panels */
.main-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; }
@media (max-width: 900px) { .main-grid { grid-template-columns: 1fr; } header { flex-direction: column; gap: 20px; } }

.panel {
    background: var(--glass-bg); backdrop-filter: blur(8px); border-radius: 24px;
    border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow);
    padding: 30px; display: flex; flex-direction: column; gap: 20px; height: 100%;
}

h2 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
h2 i { color: var(--primary); }
h3 { font-size: 14px; margin-bottom: 10px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; }

/* Inputs */
textarea, input[type="text"] {
    width: 100%; padding: 15px; border: 2px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.6); border-radius: 12px; font-size: 14px;
    transition: all 0.3s ease; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
textarea { min-height: 120px; resize: vertical; }
textarea:focus, input:focus { outline: none; border-color: var(--primary); background: white; }
.stakeholder-inputs { display: grid; gap: 10px; }

/* Personas */
.model-selector { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.persona-card {
    background: white; border: 2px solid transparent; padding: 12px; border-radius: 12px;
    cursor: pointer; transition: all 0.2s ease;
}
.persona-card:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.persona-card.selected { border-color: var(--primary); background: #f0f7ff; }
.persona-icon {
    width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
    font-size: 16px; margin-bottom: 8px; color: white;
}
.persona-name { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.persona-desc { font-size: 10px; color: var(--text-light); line-height: 1.3; }

/* Buttons */
.btn {
    background: linear-gradient(135deg, var(--primary) 0%, #3367d6 100%); color: white; border: none;
    padding: 16px; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer;
    transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; gap: 10px;
    box-shadow: 0 10px 20px -5px rgba(66, 133, 244, 0.4); width: 100%;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 15px 25px -5px rgba(66, 133, 244, 0.5); }
.btn:disabled { background: #cbd5e1; transform: none; cursor: not-allowed; }
.btn-save { background: linear-gradient(135deg, var(--accent) 0%, #0b7f45 100%); width: auto; padding: 10px 20px; font-size: 14px; }

/* Feed */
.response-feed { display: flex; flex-direction: column; gap: 15px; max-height: 500px; overflow-y: auto; padding-right: 5px; }
.response-card {
    background: white; border-radius: 12px; padding: 20px; border-left: 4px solid;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02); animation: slideIn 0.3s ease-out forwards;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.response-meta { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.response-body { font-size: 14px; line-height: 1.6; color: #374151; }

/* Synthesis */
.synthesis-section { grid-column: 1 / -1; background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(240,249,255,0.9) 100%); border: 2px dashed #bfdbfe; }
.synthesis-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.synthesis-content {
    background: white; padding: 25px; border-radius: 16px; line-height: 1.7;
    border: 2px solid transparent; transition: all 0.2s;
}
.synthesis-content:hover { border-color: #bfdbfe; cursor: text; }
.synthesis-content:focus { outline: none; border-color: var(--primary); }

/* Loader & Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 3px; }
.gemini-loader { display: flex; gap: 6px; justify-content: center; padding: 20px; }
.gemini-loader div { width: 8px; height: 8px; border-radius: 50%; animation: bounce 0.5s alternate infinite; }
.gemini-loader div:nth-child(1) { background: var(--primary); animation-delay: 0ms; }
.gemini-loader div:nth-child(2) { background: var(--secondary); animation-delay: 150ms; }
.gemini-loader div:nth-child(3) { background: var(--tertiary); animation-delay: 300ms; }
@keyframes bounce { to { transform: translateY(-10px); } }

/* Context Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(5px);
    z-index: 1000; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-content {
    background: white; width: 90%; max-width: 500px;
    border-radius: 24px; box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.8); transform: translateY(20px);
    transition: transform 0.3s ease; padding: 30px;
}
.modal-overlay.active .modal-content { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.characteristic-grid { display: grid; gap: 15px; margin-top: 15px; }
.char-item { 
    display: flex; gap: 12px; align-items: center; font-size: 13px; 
    background: #f8fafc; padding: 10px; border-radius: 8px;
}
