/* Magic Canvas - Main Stylesheet */

#magic-canvas-app {
    font-family: 'Courier New', monospace;
    background: #0a0a0f;
    color: #e0e0e0;
    min-height: 600px;
    padding: 20px;
    box-sizing: border-box;
}

.mc-container {
    display: flex;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 560px;
}

/* SVG Area */
.mc-canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #111118;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    padding: 20px;
    gap: 16px;
}

.mc-svg-wrapper {
    width: 100%;
    max-width: 500px;
}

.mc-svg-wrapper svg {
    width: 100%;
    height: auto;
}

.mc-svg-wrapper svg [class*="colorable"],
.mc-svg-wrapper svg [id*="colorable"] {
    transition: fill 0.8s ease, stroke 0.8s ease, opacity 0.8s ease;
}

.mc-placeholder {
    text-align: center;
    color: #666;
}

.mc-svg-select {
    width: 80%;
    max-width: 250px;
    margin: 0 auto;
    display: block;
    background: #1a1a2e;
    border: 1px solid #333;
    color: #ccc;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%237c5cbf'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.mc-svg-select:hover,
.mc-svg-select:focus {
    border-color: #7c5cbf;
}

.mc-svg-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mc-svg-select option {
    background: #1a1a2e;
    color: #ccc;
}

/* Input Area */
.mc-input-area {
    width: 360px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mc-title {
    font-size: 22px;
    color: #b388ff;
    margin: 0;
    text-shadow: 0 0 10px rgba(179, 136, 255, 0.3);
}

.mc-terminal {
    background: #111118;
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    padding: 16px;
}

.mc-terminal textarea {
    width: 100%;
    background: #0a0a0f;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    padding: 12px;
    resize: vertical;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}

.mc-terminal textarea:focus {
    border-color: #7c5cbf;
}

.mc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.mc-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.2s;
}

.mc-btn-primary {
    background: linear-gradient(135deg, #7c5cbf, #5b3a9e);
    color: #fff;
    flex: 1;
}

.mc-btn-primary:hover {
    background: linear-gradient(135deg, #9a7bdb, #6d4dbf);
    box-shadow: 0 0 12px rgba(124, 92, 191, 0.4);
}

.mc-btn-secondary {
    background: #1a1a2e;
    color: #b388ff;
    border: 1px solid #333;
}

.mc-btn-secondary:hover {
    background: #2a2a4a;
}

.mc-btn-ghost {
    background: transparent;
    color: #666;
}

.mc-btn-ghost:hover {
    color: #aaa;
}

.mc-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Spinner */
.mc-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mc-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

@keyframes mc-spin {
    to { transform: rotate(360deg); }
}

/* Comment & Error */
.mc-comment {
    background: #1a1a2e;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    padding: 12px;
    color: #b388ff;
    font-style: italic;
    font-size: 13px;
}

.mc-error {
    background: #2a0a0a;
    border: 1px solid #5a2a2a;
    border-radius: 8px;
    padding: 12px;
    color: #ff6b6b;
    font-size: 13px;
}

/* Glow effect (dynamically applied) */
@keyframes mc-glow {
    0%, 100% { filter: drop-shadow(0 0 4px currentColor); }
    50% { filter: drop-shadow(0 0 8px currentColor); }
}

.mc-glow {
    animation: mc-glow 2s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .mc-container {
        flex-direction: column;
    }
    .mc-input-area {
        width: 100%;
    }
}
