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

.code-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background-color: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
}

.label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.actions {
    display: flex;
    gap: 12px;
}

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

.danger-text { color: #ef4444; }

textarea {
    width: 100%;
    height: 250px;
    padding: 16px;
    border: none;
    resize: vertical;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    background-color: var(--bg-surface);
    color: var(--text-main);
    outline: none;
    line-height: 1.6;
}

textarea:focus { background-color: var(--bg-body); }

/* Stats Bar */
.stats-bar {
    padding: 8px 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-body);
    text-align: right;
}

/* Controls Grid */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.control-btn {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 14px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.control-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.control-btn:active {
    transform: scale(0.98);
    background-color: var(--primary-light);
}

/* Download Section */
.download-section {
    display: flex;
    gap: 12px;
}

.download-section button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: transform 0.1s;
}

.download-section button:active { transform: scale(0.98); }

.primary-btn {
    background-color: var(--primary-blue);
    color: white;
}

.secondary-btn {
    background-color: transparent;
    border: 1px solid var(--border-color) !important;
    color: var(--text-muted);
}

.secondary-btn:hover {
    color: var(--text-main);
    border-color: var(--text-main) !important;
}

/* Modal & Toast (Standard) */
.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; }

@media (max-width: 600px) {
    textarea { height: 200px; }
    .download-section { flex-direction: column; }
}