/* AUTOMATION Creators Brand Guidelines for Dashboard */

/* Brand Color Variables */
:root {
    /* Primary Brand Colors */
    --brand-cyan: #00D9D9;
    --brand-black: #000000;
    --brand-white: #FFFFFF;
    --brand-dark-gray: #2d3748;
    --brand-muted-cyan: #008B8B;

    /* Functional Colors - Light Theme */
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --accent-primary: #00D9D9;
    --accent-hover: #00bfbf;
    --border-color: #e2e8f0;

    /* Status Colors */
    --success-color: #00D9D9;
    --warning-color: #FFA500;
    --error-color: #dc2626;
    --info-color: #00D9D9;
}

/* Light Theme Base */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Subtle Grid Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle, #d0d0d0 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
}

/* Ensure content is above pattern */
.dashboard-container,
.dashboard-content,
.navigation {
    position: relative;
    z-index: 1;
}

/* Navigation Styling */
.navigation {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
}

.nav-link {
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: var(--bg-primary);
    color: var(--brand-cyan);
    border-left: 3px solid var(--brand-cyan);
}

.nav-link.active {
    background: var(--bg-primary);
    color: var(--brand-cyan);
    border-left: 3px solid var(--brand-cyan);
    font-weight: 600;
}

/* Header Styling */
.header,
.dashboard-header {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--brand-cyan);
    color: var(--text-primary);
}

.brand-name {
    color: var(--brand-cyan);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Card Styling - Strong Overrides */
.card,
.project-card,
.agent-card,
.overview-card,
.stat-card,
.summary-card,
div[style*="background: #1e293b"],
div[style*="background: #0f172a"],
div[style*="background: #334155"],
div[style*="background: rgb(30, 41, 59)"],
div[style*="background: rgb(15, 23, 42)"],
div[style*="background: white"],
div[style*="background: #fff"],
div[style*="background: #ffffff"] {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 6px rgba(0, 217, 217, 0.1);
    transition: all 0.3s ease;
}

/* Force text visibility on all cards */
.card *,
.project-card *,
.agent-card *,
.overview-card *,
.stat-card *,
.summary-card * {
    color: var(--text-primary) !important;
}

.card:hover,
.project-card:hover,
.agent-card:hover {
    border-color: var(--brand-cyan);
    box-shadow: 0 8px 12px rgba(0, 217, 217, 0.2);
    transform: translateY(-2px);
}

/* Section Headers */
.section-header h2,
h1, h2 {
    color: var(--text-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

h3 {
    color: var(--text-primary) !important;
    font-weight: 600 !important;
}

/* Override ALL dark backgrounds - Force light theme */
div[style*="background: #1e293b"],
div[style*="background: #0f172a"],
div[style*="background: #334155"],
div[style*="background: #1f2937"],
div[style*="background: #111827"],
div[style*="background: rgb(30, 41, 59)"],
div[style*="background: rgb(15, 23, 42)"],
div[style*="background: rgb(51, 65, 85)"],
div[style*="background: rgb(31, 41, 55)"],
div[style*="background: rgb(17, 24, 39)"],
div[style*="background-color: #1e293b"],
div[style*="background-color: #0f172a"],
div[style*="background-color: #334155"],
section[style*="background"],
.overview-section > div,
.dashboard-section > div {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

/* Override light backgrounds */
div[style*="background: white"],
div[style*="background: #fff"],
div[style*="background: #ffffff"],
div[style*="background: #f8fafc"],
div[style*="background-color: white"] {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

/* Force dark text on all elements inside dark containers */
div[style*="background: #1e293b"] *,
div[style*="background: #0f172a"] *,
div[style*="background: #334155"] *,
div[style*="background: rgb(30, 41, 59)"] *,
div[style*="background: rgb(15, 23, 42)"] * {
    color: var(--text-primary) !important;
}

/* Fix overview section specifically */
.overview-section {
    background: transparent !important;
}

.overview-section > div {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

/* Fix dashboard main content area */
.dashboard-content {
    background: var(--bg-primary) !important;
}

/* Agent Management & Cost Tracking - Force Light Theme */
.agents-section {
    background: transparent !important;
}

.cost-overview-cards {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    margin-bottom: 30px !important;
}

.cost-card,
.detailed-agent-card,
.master-controls,
.control-section {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    padding: 24px !important;
    color: var(--text-primary) !important;
}

.cost-card * {
    color: var(--text-primary) !important;
}

.cost-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.cost-header h3 {
    color: var(--text-primary) !important;
    font-size: 1.1em !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

.cost-amount {
    color: #00D9D9 !important;
    font-size: 1.8em !important;
    font-weight: 700 !important;
}

.cost-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-stat {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.cost-stat:last-child {
    border-bottom: none;
}

.cost-label {
    color: var(--text-secondary) !important;
    font-weight: 500;
}

.cost-value {
    color: var(--text-primary) !important;
    font-weight: 600;
}

.status-badge {
    padding: 4px 12px !important;
    border-radius: 12px !important;
    font-size: 0.85em !important;
    font-weight: 500 !important;
    background: #dcfce7 !important;
    color: #166534 !important;
}

.status-badge.healthy {
    background: #dcfce7 !important;
    color: #166534 !important;
}

/* Master Controls */
.master-controls {
    margin-bottom: 30px !important;
}

.control-section h3 {
    color: var(--text-primary) !important;
    margin-bottom: 16px !important;
}

.control-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 0.95em !important;
    cursor: pointer !important;
    border: none !important;
    transition: all 0.3s ease !important;
}

.control-btn.primary {
    background: #2563eb !important;
    color: white !important;
}

.control-btn.secondary {
    background: #059669 !important;
    color: white !important;
}

.control-btn.warning {
    background: #dc2626 !important;
    color: white !important;
}

.control-btn:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Detailed Agent Cards */
.detailed-agents-list {
    margin-top: 30px;
}

.detailed-agents-list > h3 {
    color: var(--text-primary) !important;
    margin-bottom: 20px !important;
}

.detailed-agent-card {
    margin-bottom: 20px !important;
}

.agent-main-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.agent-identity h4 {
    color: var(--text-primary) !important;
    margin: 0 0 8px 0 !important;
    font-weight: 600 !important;
}

.agent-description {
    color: var(--text-secondary) !important;
    font-size: 0.9em !important;
    margin: 0 !important;
}

.agent-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    font-size: 1.2em;
}

.status-indicator.dormant {
    color: #64748b !important;
}

.status-text {
    color: var(--text-secondary) !important;
    font-size: 0.9em !important;
}

.agent-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--bg-primary) !important;
    border-radius: 8px;
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-section label {
    color: var(--text-secondary) !important;
    font-size: 0.85em !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-section span {
    color: var(--text-primary) !important;
    font-size: 0.95em !important;
}

.schedule-info,
.last-run,
.impact-scope,
.folders-affected {
    color: var(--text-primary) !important;
}

.api-status.no-api {
    color: var(--text-secondary) !important;
}

.risk-low {
    color: #059669 !important;
    font-weight: 600 !important;
}

/* Agent Action Buttons */
.agent-actions-row {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.agent-btn {
    padding: 8px 16px !important;
    border-radius: 6px !important;
    font-size: 0.9em !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border: 1px solid var(--border-color) !important;
}

.agent-btn.run {
    background: #2563eb !important;
    color: white !important;
    border-color: #2563eb !important;
}

.agent-btn.pause {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

.agent-btn.logs {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

.agent-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Button Styling */
button,
.btn,
.action-btn {
    background: var(--brand-cyan);
    color: var(--brand-black);
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

button:hover,
.btn:hover,
.action-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 217, 217, 0.3);
}

button:active {
    transform: scale(0.98);
}

/* Secondary Buttons */
button[style*="background: #f8fafc"],
.btn-secondary {
    background: var(--bg-secondary) !important;
    color: var(--brand-cyan) !important;
    border: 2px solid var(--brand-cyan) !important;
}

button[style*="background: #f8fafc"]:hover,
.btn-secondary:hover {
    background: var(--brand-cyan) !important;
    color: var(--brand-black) !important;
}

/* Accent/Primary Buttons */
button[style*="background: #2563eb"],
button[style*="background: #3b82f6"] {
    background: var(--brand-cyan) !important;
    color: var(--brand-black) !important;
}

/* Text Colors */
p, span, div, li, td, th {
    color: inherit;
}

/* Secondary Text */
[style*="color: #64748b"],
[style*="color: #94a3b8"],
[style*="color: #cbd5e1"],
[style*="color: rgb(100, 116, 139)"],
[style*="color: rgb(148, 163, 184)"],
.text-secondary {
    color: var(--text-secondary) !important;
}

/* Labels and small text */
label,
.label,
.stat-label,
small {
    color: var(--text-secondary) !important;
    font-weight: 500;
}

/* Values and numbers should be prominent */
.stat-value,
.number,
[style*="font-size: 2rem"],
[style*="font-size: 1.5rem"] {
    color: var(--text-primary) !important;
    font-weight: 700;
}

/* Sprint Planning Kanban Columns */
div[style*="background: #f8fafc"],
div[style*="background: #fef3c7"],
div[style*="background: #dcfce7"] {
    background: var(--bg-card) !important;
    border-left-color: var(--brand-cyan) !important;
}

/* Task Cards within Sprint Planning */
div[style*="background: #f8fafc"] div[style*="padding: 12px"],
div[style*="background: #fef3c7"] div[style*="padding: 12px"],
div[style*="background: #dcfce7"] div[style*="padding: 12px"] {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-left-color: var(--brand-cyan) !important;
}

/* Stats Cards */
.stat-card,
.summary-card,
.analytics-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.stat-card:hover,
.summary-card:hover {
    border-color: var(--brand-cyan);
    box-shadow: 0 4px 12px rgba(0, 217, 217, 0.15);
}

/* Gradient Cards - Preserve with Brand Colors */
div[style*="linear-gradient"] {
    border: 1px solid var(--brand-cyan);
}

/* Links */
a {
    color: var(--brand-cyan);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Tables */
table {
    background: var(--bg-card);
    color: var(--text-primary);
}

thead {
    background: var(--bg-secondary) !important;
}

th {
    color: var(--text-primary) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

tr {
    border-bottom: 1px solid var(--border-color);
}

tr:hover {
    background: var(--bg-secondary);
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--brand-cyan);
    box-shadow: 0 0 0 3px rgba(0, 217, 217, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-secondary);
}

/* Tags and Badges */
.tag,
.badge,
span[style*="padding: 4px"],
span[style*="padding: 2px 6px"] {
    background: var(--bg-secondary);
    color: var(--brand-cyan);
    border: 1px solid var(--brand-cyan);
    border-radius: 12px;
    padding: 4px 12px;
    font-size: 0.85em;
    font-weight: 500;
}

/* Agent Status Indicators */
.health-icon {
    filter: brightness(1.2);
}

.agent-card.healthy {
    border-left: 3px solid var(--success-color);
}

.agent-card.warning {
    border-left: 3px solid var(--warning-color);
}

.agent-card.critical {
    border-left: 3px solid var(--error-color);
}

/* Progress Bars */
.progress-bar {
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--brand-cyan), var(--brand-muted-cyan));
    height: 100%;
    transition: width 0.3s ease;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-cyan);
}

/* Modal Styling */
.modal,
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

/* Notifications */
.notification {
    background: var(--bg-card);
    border-left: 4px solid var(--brand-cyan);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.notification.success {
    border-left-color: var(--success-color);
}

.notification.error {
    border-left-color: var(--error-color);
}

.notification.warning {
    border-left-color: var(--warning-color);
}

/* Dashboard Grid */
.overview-section {
    gap: 20px;
}

/* Project Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

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

/* Loading States */
.loading {
    color: var(--brand-cyan);
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Code Blocks */
code, pre {
    background: var(--bg-secondary);
    color: var(--brand-cyan);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 2px 6px;
    font-family: 'Courier New', monospace;
}

pre {
    padding: 15px;
    overflow-x: auto;
}

/* Emphasis */
strong, b {
    color: var(--brand-cyan);
    font-weight: 700;
}

em, i {
    color: var(--brand-cyan);
}

/* Dividers */
hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 20px 0;
}

/* Tooltips */
.tooltip {
    background: var(--brand-dark-gray);
    color: var(--brand-white);
    border: 1px solid var(--brand-cyan);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 2px solid var(--brand-cyan);
    color: var(--text-secondary);
    text-align: center;
    padding: 20px;
}

/* Brand Identifier */
.brand-tagline {
    color: var(--brand-cyan);
    font-size: 0.9em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Animation for brand elements */
@keyframes pulse-cyan {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 217, 217, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(0, 217, 217, 0);
    }
}

.pulse-accent {
    animation: pulse-cyan 2s infinite;
}
