:root {
    --bg-color: #1a1a2e;
    --bg-gradient-start: #16213e;
    --bg-gradient-end: #0f3460;
    --text-color: #f0f0f0;
    --panel-bg: #2a3f5f;
    --panel-border: #4a90a4;
    --accent-color: #ffd369; /* Warm golden */
    --accent-hover: #ffe89e;
    --border-color: #5a7c92;
    --success-color: #4ecdc4;
    --warning-color: #ff6b6b;
    --grass-color: #86c06c;
    --sky-color: #a8d5e2;
}

body {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 15px;
    box-sizing: border-box;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 12px 18px;
    background: rgba(42, 63, 95, 0.6);
    border-bottom: 3px solid var(--panel-border);
    border-radius: 10px 10px 0 0;
    backdrop-filter: blur(10px);
}

h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
    letter-spacing: 1px;
}

.status-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 280px;
}

#status-text {
    font-size: 12px;
    color: var(--success-color);
    text-align: right;
    font-weight: 500;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    opacity: 1;
    transition: opacity 0.5s ease;
}

.progress-bar-container.hidden {
    opacity: 0;
    height: 0;
    margin: 0;
    border: none;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-color) 0%, var(--accent-hover) 50%, var(--accent-color) 100%);
    background-size: 200% 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    animation: shimmer 2s infinite;
    box-shadow: 0 0 10px rgba(255, 211, 105, 0.6);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

main {
    display: flex;
    flex: 1;
    gap: 15px;
    overflow: hidden;
}

.canvas-container {
    flex: 2;
    background: linear-gradient(to bottom, var(--sky-color) 0%, var(--grass-color) 60%);
    border: 3px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.1);
    position: relative;
}

.canvas-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

canvas {
    background: linear-gradient(to bottom, #a8d5e2 0%, #86c06c 45%, #6ba54a 100%);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 320px;
    max-width: 380px;
    overflow: hidden;
}

.panel {
    background: linear-gradient(135deg, rgba(42, 63, 95, 0.9) 0%, rgba(42, 63, 95, 0.7) 100%);
    border: 2px solid var(--panel-border);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.panel:first-child {
    flex: 1;
    min-height: 0;
}

.panel h2 {
    font-size: 15px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--panel-border);
    padding-bottom: 12px;
    color: var(--accent-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.scrollable-content {
    flex: 1;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.8;
    padding-right: 10px;
    min-height: 0;
}

/* Custom Scrollbar for Webkit */
.scrollable-content::-webkit-scrollbar {
    width: 10px;
}

.scrollable-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.scrollable-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-color) 0%, var(--panel-border) 100%);
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.3);
}

.scrollable-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

.log-entry {
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
    transition: all 0.2s ease;
}

.log-entry:hover {
    background: rgba(0, 0, 0, 0.35);
    transform: translateX(3px);
}

.log-entry .agent-name {
    color: var(--accent-color);
    font-weight: 700;
}

.log-entry .timestamp {
    color: #95a5b8;
    margin-right: 10px;
    font-size: 11px;
}

.log-entry .message {
    color: #e0e0e0;
}

button {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    color: #1a1a2e;
    border: none;
    padding: 12px 20px;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(255, 211, 105, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

button:disabled {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    color: #718096;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 211, 105, 0.5);
}

button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 211, 105, 0.3);
}

textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 13px;
    resize: vertical;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 12px rgba(255, 211, 105, 0.3);
    background: rgba(0, 0, 0, 0.4);
}

textarea::placeholder {
    color: #95a5b8;
}
