/* Virtual CMO - Styles */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --radius: 8px;
}

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

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

/* Navigation */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.nav-brand a {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    background: #eff6ff;
}

.nav-divider {
    color: var(--border);
    margin: 0 0.5rem;
}

.nav-section {
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 0.5rem;
}

.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.business-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 200px;
}

.business-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
    user-select: none;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 280px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 0.5rem;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s;
    border-radius: 0;
}

.dropdown-menu a:hover {
    background: var(--bg);
    color: var(--primary);
}

.dropdown-header {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
}

.subtitle {
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Cards */
.principles-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.principles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.principle {
    text-align: center;
    padding: 1rem;
}

.principle-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.principle h3 {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Grids */
.actions-grid,
.businesses-grid,
.agents-grid,
.workflows-grid {
    display: grid;
    gap: 1.5rem;
}

.actions-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.businesses-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.agents-grid,
.workflows-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Action Cards */
.action-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.action-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.action-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.action-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.action-card p {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Business Cards */
.business-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.business-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.business-card .niche {
    color: var(--primary);
    font-size: 0.9rem;
}

.business-card .location {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

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

.quick-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Agent Cards */
.agent-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    position: relative;
}

.agent-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.agent-status.active {
    background: var(--success);
}

.agent-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.agent-card .capabilities {
    font-size: 0.8rem;
    color: var(--text-light);
}

.agent-card .actions {
    font-size: 0.75rem;
    color: var(--primary);
    margin-top: 0.5rem;
}

/* Workflow Cards */
.workflow-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.workflow-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.workflow-card p {
    font-size: 0.85rem;
    color: var(--text-light);
}

.workflow-card .meta {
    font-size: 0.75rem;
    color: var(--primary);
    margin-top: 0.5rem;
}

/* Section Headers */
section {
    margin-bottom: 2rem;
}

section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-content.wide {
    max-width: 800px;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.close:hover {
    color: var(--text);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Result Areas */
.result-area {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--bg);
}

.loading {
    color: var(--text-light);
    font-style: italic;
}

.success {
    color: var(--success);
}

.error {
    color: var(--danger);
}

.result-area h4 {
    margin-bottom: 0.75rem;
}

.result-area h5 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.preview-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preview-item {
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.preview-item strong {
    display: block;
    margin-bottom: 0.25rem;
}

.preview-item p {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Cost Display */
.cost-summary {
    margin-bottom: 2rem;
}

.cost-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
}

.stat .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.stat .label {
    font-size: 0.8rem;
    color: var(--text-light);
}

.cost-breakdown table {
    width: 100%;
    border-collapse: collapse;
}

.cost-breakdown th,
.cost-breakdown td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.cost-breakdown th {
    background: var(--bg);
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.empty-state h3 {
    margin-bottom: 0.5rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .container {
        padding: 1rem;
    }
}
