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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}

#header {
    background-color: #4CAF50;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#header h1 {
    font-size: 24px;
    font-weight: 600;
}

#auth-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

#auth-section input {
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    background-color: rgba(255,255,255,0.2);
    color: white;
    font-size: 14px;
}

#auth-section input::placeholder {
    color: rgba(255,255,255,0.7);
}

#auth-section button {
    padding: 8px 16px;
    background-color: white;
    color: #4CAF50;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

#auth-section button:hover {
    background-color: #f0f0f0;
}

#connection-status {
    padding: 8px 12px;
    background-color: rgba(255,255,255,0.2);
    border-radius: 4px;
    font-size: 12px;
}

#connection-status.connected {
    background-color: rgba(76, 175, 80, 0.8);
}

#connection-status.disconnected {
    background-color: rgba(244, 67, 54, 0.8);
}

#main-container {
    display: flex;
    height: calc(100vh - 60px);
}

/* Blockly flyout styling */
.blocklyFlyout {
    background-color: #f9f9f9;
}

.blocklyFlyoutButton {
    fill: #4CAF50;
}

#workspace-container {
    flex: 1;
    position: relative;
}

#blockly-workspace {
    width: 100%;
    height: 100%;
}

#sidebar {
    width: 250px;
    background-color: #fff;
    border-left: 1px solid #ddd;
    padding: 20px;
    overflow-y: auto;
}

#sidebar h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 5px;
}

#sidebar button {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

#run-btn {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff !important;
    border: 3px solid #4CAF50 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

#run-btn:not(:disabled):hover {
    background-color: #f0f8f0 !important;
    border-color: #45a049 !important;
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
    transform: translateY(-1px);
}

#run-btn:not(:disabled):active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.2);
}

#run-btn svg {
    width: 28px;
    height: 28px;
}

#run-btn:disabled {
    background-color: #e0e0e0 !important;
    border-color: #bdbdbd !important;
    cursor: not-allowed;
    opacity: 0.6;
}

#run-btn:disabled svg {
    opacity: 0.5;
}

#sidebar button:hover:not(:disabled) {
    background-color: #45a049;
}

#sidebar button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#variables-display {
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 4px;
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 12px;
}

#output-display {
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 4px;
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 12px;
}

.variable-item {
    padding: 5px;
    margin-bottom: 5px;
    background-color: white;
    border-left: 3px solid #4CAF50;
    padding-left: 10px;
}

.output-item {
    padding: 5px;
    margin-bottom: 5px;
    color: #666;
}

.output-item.error {
    color: #f44336;
}

.output-item.success {
    color: #4CAF50;
}

/* Searchable dropdown styles */
.blockly-dropdown-search {
    width: calc(100% - 16px);
    margin: 8px;
    padding: 6px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    flex-shrink: 0; /* Prevent search bar from shrinking */
}

.blockly-dropdown-search:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.blockly-no-results {
    padding: 10px;
    text-align: center;
    color: #999;
    font-style: italic;
    font-size: 13px;
    flex-shrink: 0;
}

/* Ensure dropdown content container handles overflow properly */
.blocklyDropDownDiv .goog-menu,
.blocklyDropDownDiv div[role="menu"],
.blocklyDropDownDiv .blocklyDropdownMenu {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: calc(400px - 60px) !important; /* Account for search bar */
}

/* Make sure the dropdown div itself doesn't overflow */
.blocklyDropDownDiv > div {
    display: flex;
    flex-direction: column;
    max-height: 400px;
    overflow: hidden;
}
