/* Tool Specific Styles */
.tool-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Preview Box */
.preview-card {
    height: 200px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--bg-surface);
    position: relative;
    transition: background 0.2s ease;
}

.preview-label {
    background: rgba(0,0,0,0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

/* Controls Card */
.controls-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.control-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.color-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 2px solid var(--border-color);
    padding: 6px;
    border-radius: var(--radius-md);
    background: var(--bg-body);
}

input[type="color"] {
    -webkit-appearance: none;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
    padding: 0;
}

input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 6px; }

input[type="text"] {
    width: 100%;
    border: none;
    background: none;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    outline: none;
    text-transform: uppercase;
}

.icon-btn-round {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px; /* Align with inputs */
}

.icon-btn-round:hover {
    background: var(--bg-surface);
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

/* Slider */
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
}

.slider-header label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

#angle-val {
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary-blue);
    font-weight: 600;
}

input[type=range] {
    width: 100%;
    height: 6px;
    background: var(--bg-body);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    border: 1px solid var(--border-color);
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-blue);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.direction-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

/* Secondary Button (Random) */
.secondary-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 12px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.secondary-btn:hover {
    background-color: var(--bg-body);
    border-color: var(--text-muted);
}

/* Code Output */
.code-card {
    background-color: #1e293b; /* Always dark for code */
    border-radius: var(--radius-md);
    overflow: hidden;
}

.code-header {
    background-color: #0f172a;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.code-header span {
    color: #94a3b8;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
}

.text-btn {
    background: none;
    border: none;
    color: var(--primary-blue);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

.code-block {
    padding: 20px;
    color: #e2e8f0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    word-break: break-all;
    line-height: 1.5;
}

/* Modal & Toast (Reused) */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px); transition: all 0.3s ease;
}
.modal-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.modal-content {
    background: var(--bg-surface); width: 90%; max-width: 400px;
    padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--border-color);
}
.modal-header { display: flex; justify-content: space-between; margin-bottom: 16px; }
.modal-header h3 { font-size: 1.2rem; font-weight: 700; color: var(--text-main); }
.modal-body p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 12px; }
.icon-button { background: none; border: none; padding: 6px; cursor: pointer; color: var(--text-muted); }

.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
    background-color: var(--accent-green); color: white; padding: 12px 24px;
    border-radius: 50px; font-weight: 600; font-size: 0.9rem;
    opacity: 0; visibility: hidden; transition: all 0.3s ease; z-index: 3000;
}
.toast.visible { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.hidden { display: none !important; }