:root {
    /* Modern Color Palette */
    --primary-color: #4F46E5;  /* Indigo */
    --primary-hover: #4338CA;
    --secondary-color: #0EA5E9;  /* Sky Blue */
    --background-color: #F8FAFC;
    --surface-color: #FFFFFF;
    --border-color: #E2E8F0;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --success-color: #10B981;
    --error-color: #EF4444;
    --warning-color: #F59E0B;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

h1 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.platform-toggle {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.platform-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-color);
    border-radius: 9999px;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 600;
    min-width: 120px;
}

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

.platform-btn:hover:not(.active) {
    background: rgba(79, 70, 229, 0.1);
}

/* Main Content Grid */
.main-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* Section Styles */
.section {
    background: var(--surface-color);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.section:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

/* Form Controls */
.control-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

input[type="text"],
input[type="number"],
input[type="password"],
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background-color: var(--surface-color);
    color: var(--text-primary);
}

input:focus,
select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Platform Config */
.platform-config {
    background: var(--background-color);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-top: 1rem;
}

/* Help Text */
.help-text {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.help-text p {
    color: var(--warning-color);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.help-text a:hover {
    text-decoration: underline;
}

/* Action Buttons */
.actions {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    justify-content: center;
}

button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.2s ease;
}

button:hover:not(:disabled)::after {
    opacity: 1;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Add loading indicator for start button */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

button:disabled:not(.stopped) {
    animation: pulse 1.5s infinite;
}

/* Status indicator */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.status-indicator.running {
    background-color: var(--success-color);
    color: white;
}

.status-indicator.stopped {
    background-color: var(--error-color);
    color: white;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Status Panel */
.status-panel {
    grid-column: 1 / -1;
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

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

.metric {
    background: var(--background-color);
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.metric-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.metric span:not(.metric-label) {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Log Section */
.log {
    height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
}

.log-entry {
    margin: 0.75rem 0;
    padding: 1rem;
    border-radius: 0.5rem;
    line-height: 1.5;
    border-left: 4px solid transparent;
    background-color: var(--background-color);
    font-family: 'Inter', sans-serif;
}

.log-time {
    color: var(--text-secondary);
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    margin-right: 0.5rem;
}

.log-message {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.log-details {
    font-size: 0.9rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 0.375rem;
    margin-top: 0.5rem;
    white-space: pre-wrap;
    line-height: 1.6;
}

.log-key {
    color: var(--primary-color);
    font-weight: 600;
    margin-right: 0.5rem;
}

.log-entry.info {
    border-left-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.1);
}

.log-entry.success {
    border-left-color: var(--success-color);
    background-color: rgba(16, 185, 129, 0.1);
}

.log-entry.error {
    border-left-color: var(--error-color);
    background-color: rgba(239, 68, 68, 0.1);
}

.log-entry.warning {
    border-left-color: var(--warning-color);
    background-color: rgba(245, 158, 11, 0.1);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #0F172A;
        --surface-color: #1E293B;
        --border-color: #334155;
        --text-primary: #F8FAFC;
        --text-secondary: #94A3B8;
    }

    input,
    select,
    .platform-config {
        background-color: #1E293B;
        color: var(--text-primary);
        border-color: var(--border-color);
    }

    .log {
        background-color: #1E293B;
    }

    .metric {
        background-color: #1E293B;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .main-content {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }

    .metrics {
        grid-template-columns: 1fr;
    }
}

.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.notification {
    padding: 12px 24px;
    margin-bottom: 10px;
    border-radius: 4px;
    color: white;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.notification.success {
    background-color: #4caf50;
}

.notification.error {
    background-color: #f44336;
}

.notification.info {
    background-color: #2196f3;
}

.notification.fade-out {
    opacity: 0;
}