/* Container */
.switcheroo-material-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    padding: 20px;
    margin: 30px 0;
    font-family: 'Roboto', sans-serif;
    border: 1px solid #eee;
}

.demo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

/* --- TOOLBAR LAYOUT --- */
.translate-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: center; /* helps swap button alignment */
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
    padding: 5px 15px;
    margin-bottom: 0;
}

.example-toolbar {
    background: #fff;
    border-bottom: 1px solid #ddd;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    padding: 5px 15px;
    font-size: 13px;
    display: flex;
    align-items: center;
    color: #666;
}

.example-toolbar .label {
    margin-right: 10px;
    font-weight: 500;
}

.select-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
}

.toolbar-label {
    margin-right: 8px;
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

/* Material Drops */
.material-select {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    border: none;
    background: transparent;
    color: #1976d2;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
    appearance: none; /* Hide default arrow */
    background-image: url('data:image/svg+xml;utf8,<svg fill="%231976d2" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
}

.material-select-sm {
    border: 1px solid #eee;
    background: #fdfdfd;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    flex: 1;
}

.material-select:focus, .material-select-sm:focus {
    outline: none;
    border-bottom-color: #1976d2;
}

/* Swap Button (Circular) */
.swap-icon-btn {
    background: #fff;
    border: 1px solid #ddd;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #5f6368;
    margin: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
}

.swap-icon-btn:hover {
    background: #f1f3f4;
    transform: rotate(180deg); /* Nice spin effect */
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.swap-icon-btn:active {
    background: #e8eaed;
}

/* --- CodeMirror Integration (Feature 0) --- */
.editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background-color: #ddd; /* Acts as border between */
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    height: 400px; /* Increased height for better view */
    margin-bottom: 20px;
}

.editor-group {
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Contain CodeMirror */
}

/* CodeMirror Overrides */
.CodeMirror {
    height: 100% !important;
    font-family: 'Roboto Mono', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.5;
    background-color: #fff;
}

/* Different BG for Target Editor */
.target-group .CodeMirror {
    background-color: #f7f9fb;
}
.target-group .CodeMirror-cursor {
    display: none; /* mimic readonly visually */
}

/* Hide fallback textareas */
.material-input {
    display: none;
}

/* --- Controls & Logs --- */
.controls-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}

/* Standard Material Button */
.md-btn {
    text-transform: uppercase;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    box-shadow: 0 3px 1px -2px rgba(0,0,0,0.2), 0 2px 2px 0 rgba(0,0,0,0.14), 0 1px 5px 0 rgba(0,0,0,0.12);
    transition: box-shadow 0.2s, background 0.2s;
    letter-spacing: 0.05em;
}

.md-btn-primary { background-color: #2196f3; color: white; }
.md-btn-primary:hover { background-color: #1976d2; }

.md-btn-accent { background-color: #ff4081; color: white; }
.md-btn-accent:hover { background-color: #f50057; }

.md-btn:disabled {
    background-color: #e0e0e0;
    color: #9e9e9e;
    box-shadow: none;
    cursor: default;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    background: #eee;
}
.status-ready { background: #e8f5e9; color: #2e7d32; }
.status-loading { background: #fff3e0; color: #ef6c00; }
.status-error { background: #ffebee; color: #c62828; }

#console-output {
    background: #263238;
    color: #eceff1;
    border-radius: 4px;
    padding: 12px;
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    height: 150px;
    overflow-y: auto;
    white-space: pre-wrap;
    margin-top: 10px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.editor-label {
    font-size: 12px;
    font-weight: bold;
    color: #777;
    margin-bottom: 5px;
    text-transform: uppercase;
}

/* --- Material Switch --- */
.md-switch {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    gap: 8px;
}

.md-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    position: absolute;
}

.md-switch-text {
    font-size: 13px;
    font-weight: 500;
    color: #5f6368;
    text-transform: uppercase;
}

.md-switch-track {
    position: relative;
    width: 36px;
    height: 14px;
    background-color: #b0bec5;
    border-radius: 7px;
    transition: background-color 0.2s;
}

.md-switch-thumb {
    position: absolute;
    top: -3px;
    left: -2px;
    width: 20px;
    height: 20px;
    background-color: #eceff1;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transition: transform 0.2s, background-color 0.2s;
}

/* Checked State */
.md-switch input:checked + .md-switch-track {
    background-color: #90caf9; /* Light Blue */
}

.md-switch input:checked + .md-switch-track .md-switch-thumb {
    background-color: #2196f3; /* Blue Primary */
    transform: translateX(20px);
}

/* Hover/Focus States */
.md-switch:hover .md-switch-thumb {
    box-shadow: 0 0 0 8px rgba(0,0,0,0.05); /* Halo effect */
}
