:root {
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --border-color: #e2e8f0;
    --accent-light: #eff6ff;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, hsla(217,100%,94%,1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(217,100%,94%,0.8) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem;
}

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

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    animation: fadeInDown 0.6s ease-out;
}

.dashboard-header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

.dashboard-header h1 span {
    color: var(--primary-color);
}

.dashboard-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.status-badge {
    background-color: #dcfce7;
    color: #166534;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
    animation: pulse 2s infinite;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    align-items: start;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.glass-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.control-panel {
    animation: slideInLeft 0.6s ease-out;
}

.control-panel h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '▼';
    font-size: 0.7rem;
    color: var(--text-secondary);
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

select {
    width: 100%;
    appearance: none;
    padding: 0.875rem 1.25rem;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

select:disabled {
    cursor: not-allowed;
    background-color: #f1f5f9;
    color: #94a3b8;
    box-shadow: none;
}

.primary-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 2rem;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.btn-icon {
    transition: transform 0.3s ease;
}

.primary-btn:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.4);
}

.primary-btn:hover:not(:disabled) .btn-icon {
    transform: translateY(-2px);
}

.primary-btn:disabled {
    background-color: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

.primary-btn:active:not(:disabled) {
    transform: translateY(0);
}

.results-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: slideInRight 0.6s ease-out;
}

.hidden {
    display: none !important;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 480px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    transition: var(--transition);
}

.empty-state:hover {
    border-color: #94a3b8;
    background: rgba(255, 255, 255, 0.8);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

/* Insights Card styles */
.insights-card h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
}
.insights-card h3 span {
    color: var(--primary-color);
    font-weight: 600;
}

.tags-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    background-color: var(--accent-light);
    color: var(--primary-color);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.1);
}

.sub-heading {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.history-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.visit-item {
    padding: 1rem;
    background-color: rgba(248, 250, 252, 0.8);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.visit-item:hover {
    background-color: #ffffff;
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.visit-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.visit-products {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Prompt Card styles */
.prompt-card textarea {
    width: 100%;
    height: 280px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #f8fafc;
    font-family: inherit;
    font-size: 0.95rem;
    color: #1e293b;
    resize: vertical;
    line-height: 1.6;
    transition: var(--transition);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.prompt-card textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.icon-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

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

/* Responsive */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
