@charset "UTF-8";

/* ========================================
   Tool Template - Shared Styles
   Used by all individual tool pages 
   ======================================== */

/* ---------- General Tool Input ---------- */
.tool-input-area {
    padding: 1.5rem;
}

.tool-input-area label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
    margin-bottom: 0.5rem;
}

.tool-input-area textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Noto Sans JP', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s;
}

.tool-input-area textarea:focus {
    outline: none;
    border-color: #667eea;
}

.tool-input-area textarea.monospace {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    tab-size: 2;
}

/* ---------- Tool Output ---------- */
.tool-output-area {
    padding: 1.5rem;
    border-top: 1px solid #eee;
}

.tool-output-area pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 500px;
    overflow-y: auto;
}

/* ---------- Tool Controls (generic) ---------- */
.tool-btn-row {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    flex-wrap: wrap;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.2rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #334155;
    transition: all 0.2s;
}

.tool-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.tool-btn.active,
.tool-btn-primary {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.tool-btn-primary:hover {
    background: #5a6fd6;
}

.tool-btn-danger {
    border-color: #ef4444;
    color: #ef4444;
}

.tool-btn-danger:hover {
    background: #ef4444;
    color: white;
}

/* ---------- Result Stats ---------- */
.tool-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem;
    flex-wrap: wrap;
}

.tool-stat {
    text-align: center;
    min-width: 100px;
}

.tool-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #667eea;
}

.tool-stat-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.2rem;
}

/* ---------- Slider / Range ---------- */
.tool-slider-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
}

.tool-slider-row label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    min-width: 80px;
}

.tool-slider-row input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    cursor: pointer;
}

.tool-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    border: 3px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    cursor: pointer;
}

.tool-slider-row .range-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #667eea;
    min-width: 45px;
    text-align: right;
}

/* ---------- Select dropdown ---------- */
.tool-select {
    padding: 0.5rem 1rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    color: #334155;
    transition: border-color 0.2s;
}

.tool-select:focus {
    outline: none;
    border-color: #667eea;
}

/* ---------- Preview canvas ---------- */
.tool-preview {
    position: relative;
    width: 100%;
    background: #f0f0f0;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.tool-preview canvas,
.tool-preview img {
    max-width: 100%;
    max-height: 500px;
    display: block;
}

.tool-preview-placeholder {
    color: #94a3b8;
    font-size: 0.95rem;
    text-align: center;
    padding: 3rem;
}

/* ---------- File info bar ---------- */
.tool-file-info {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-top: 1px solid #eee;
    font-size: 0.8rem;
    color: #64748b;
    flex-wrap: wrap;
}

.tool-file-info span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* ---------- Related Tools ---------- */
.related-tools {
    padding: 3rem 0;
    background: white;
}

.related-tools h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #1e293b;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

.related-tool-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    color: #334155;
    transition: transform 0.2s, box-shadow 0.2s;
}

.related-tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.related-tool-card .rt-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.related-tool-card .rt-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.related-tool-card .rt-desc {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.15rem;
}

/* ---------- Breadcrumb ---------- */
.tool-breadcrumb {
    padding: 0.75rem 0;
    font-size: 0.82rem;
    color: #64748b;
}

.tool-breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.tool-breadcrumb a:hover {
    text-decoration: underline;
}

.tool-breadcrumb span {
    margin: 0 0.4rem;
    color: #cbd5e1;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .tool-stats {
        gap: 1rem;
    }
    .tool-stat-value {
        font-size: 1.3rem;
    }
    .related-tools-grid {
        grid-template-columns: 1fr;
    }
    .tool-slider-row {
        flex-wrap: wrap;
    }
    .tool-slider-row label {
        min-width: auto;
        width: 100%;
    }
}
