/* Dashboard Styles */

.dashboard-header {
    margin-bottom: 32px;
}
.dashboard-header h1 {
    margin-bottom: 8px;
}
.dashboard-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Create Form CTA */
.create-cta {
    background: var(--primary-light);
    border: 2px dashed var(--primary);
    border-radius: var(--radius-card);
    padding: 32px;
    text-align: center;
    margin-bottom: 32px;
    transition: all 200ms var(--ease);
    cursor: pointer;
}
.create-cta:hover {
    background: #E0E7FF;
    border-style: solid;
}
.create-cta h3 {
    color: var(--primary);
    margin-bottom: 12px;
}
.create-input-wrapper {
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
}
.create-input {
    flex: 1;
    padding: 14px 20px;
    border: 1.5px solid var(--border);
    border-radius: 24px;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    outline: none;
    background: var(--bg);
    transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.create-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-100);
}

/* Form Cards Grid */
.forms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.form-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 24px;
    transition: all 200ms var(--ease);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.form-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
    border-color: var(--primary);
}
.form-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.form-card-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
}
.form-card-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.form-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}
.form-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.form-card-action {
    padding: 6px 14px;
    border-radius: var(--radius-btn);
    font-size: 0.8rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 150ms var(--ease);
    font-family: var(--font-body);
}
.form-card-action:hover { transform: scale(1.05); }

.form-card-action.share {
    background: var(--primary-light);
    color: var(--primary);
}
.form-card-action.view {
    background: var(--surface);
    color: var(--text-secondary);
}
.form-card-action.edit {
    background: transparent;
    color: var(--text-muted);
}

/* Responses Dashboard */
.responses-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.responses-count {
    display: flex;
    align-items: center;
    gap: 8px;
}
.responses-count .count {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.export-buttons {
    display: flex;
    gap: 8px;
}

/* Search */
.search-bar {
    position: relative;
    max-width: 400px;
    margin-bottom: 20px;
}
.search-bar input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1.5px solid var(--border);
    border-radius: 24px;
    font-size: 0.875rem;
    outline: none;
}
.search-bar input:focus {
    border-color: var(--primary);
}
.search-bar svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

/* Insights */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.insight-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 24px;
}
.insight-card h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.insight-chart {
    min-height: 160px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding-top: 8px;
}

/* Bar chart */
.chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.chart-bar-fill {
    width: 100%;
    min-height: 4px;
    background: var(--primary-gradient);
    border-radius: 4px 4px 0 0;
    transition: height 600ms var(--ease);
}
.chart-bar-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chart-bar-value {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Donut chart */
.donut-chart {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    position: relative;
}
.donut-chart svg { width: 100%; height: 100%; }
.donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
}
.donut-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
    font-size: 0.8rem;
}
.donut-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.donut-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Stat card */
.stat-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}
.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.stat-row {
    display: flex;
    justify-content: space-around;
    gap: 16px;
    text-align: center;
}

/* Side panel */
.side-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 420px;
    background: var(--bg);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-modal);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 300ms var(--ease);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.side-panel.open { transform: translateX(0); }
.side-panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.side-panel-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}
.side-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-muted);
}
.side-panel-close:hover { color: var(--text-primary); }

/* Side data card */
.sidedata-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-btn);
    padding: 16px;
    margin-bottom: 12px;
}
.sidedata-key {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.sidedata-value {
    font-weight: 600;
    margin-bottom: 8px;
}
.sidedata-source {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 8px;
    padding: 6px 10px;
    background: var(--surface);
    border-radius: 6px;
}
.sidedata-actions {
    display: flex;
    gap: 8px;
}

/* Replay */
.replay-container {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 0;
    height: calc(100vh - 65px);
}
.replay-chat {
    overflow-y: auto;
    padding: 24px;
    border-right: 1px solid var(--border);
}
.replay-data {
    overflow-y: auto;
    padding: 24px;
    background: var(--surface);
}
.replay-field {
    padding: 12px;
    border-radius: var(--radius-btn);
    margin-bottom: 8px;
    transition: background 200ms var(--ease);
}
.replay-field.highlight {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
}
.replay-field-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.replay-field-value {
    font-weight: 600;
}

/* Auth pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
}
.auth-card {
    background: var(--bg);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-elevated);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    animation: slideUp 300ms var(--ease);
}
.auth-card h2 {
    text-align: center;
    margin-bottom: 8px;
}
.auth-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
}
.auth-card .btn { width: 100%; margin-top: 8px; }
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Template cards */
.template-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 24px;
    transition: all 200ms var(--ease);
}
.template-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
    border-color: var(--primary);
}
.template-card h4 { margin-bottom: 8px; }
.template-card p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 12px; }
.template-card .field-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .forms-grid { grid-template-columns: 1fr; }
    .create-input-wrapper { flex-direction: column; }
    .responses-header { flex-direction: column; align-items: flex-start; }
    .replay-container { grid-template-columns: 1fr; }
    .side-panel { width: 100%; }
    .insights-grid { grid-template-columns: 1fr; }
}
