﻿/* ===== Shared Tool Page Styles ===== */

.tool-page {
    min-height: 100vh;
    background: #f8f9fc;
}

.tool-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 1rem 2rem;
    font-size: 0.82rem;
    color: #94a3b8;
    max-width: 1100px;
    margin: 0 auto;
}

.tool-breadcrumb a {
    color: #64748b;
    text-decoration: none;
}

.tool-breadcrumb a:hover { color: #6366f1; }

.breadcrumb-sep { color: #cbd5e1; font-size: 0.75rem; }
.breadcrumb-current { color: #0f172a; font-weight: 500; }

/* Header */
.tool-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.4rem 2rem;
}

.tool-header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
}

.tool-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    border-radius: 12px;
    color: white;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.tool-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.15rem;
}

.tool-subtitle {
    font-size: 0.88rem;
    color: #64748b;
    margin: 0;
}

/* Body */
.tool-body {
    padding: 1.5rem 2rem 4rem;
    max-width: 1100px;
    margin: 0 auto;
}

/* Two-panel layout */
.tool-panels {
    display: grid;
    grid-template-columns: 1fr 52px 1fr;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    min-height: 320px;
    margin-bottom: 1rem;
}

.tool-panel {
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: #f8f9fc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    gap: 0.5rem;
}

.panel-header-title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-panel {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.18rem 0.55rem;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    background: white;
    color: #64748b;
    font-size: 0.73rem;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-panel:hover {
    background: #f5f3ff;
    color: #6366f1;
    border-color: #c7d2fe;
}

.panel-textarea {
    flex: 1;
    width: 100%;
    padding: 1rem;
    border: none;
    outline: none;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.65;
    color: #0f172a;
    background: white;
    resize: none;
    min-height: 260px;
    box-sizing: border-box;
}

.panel-textarea:read-only { background: #fafafa; }

/* Panel divider */
.panel-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fc;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-convert {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #6366f1;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s, transform 0.15s;
}

.btn-convert:hover { background: #4f46e5; transform: scale(1.08); }

/* Options bar */
.tool-options {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: center;
}

.tool-option-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tool-option-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Action buttons row */
.tool-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.btn-action-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.62rem 1.5rem;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-action-primary:hover { background: #4f46e5; }

.btn-action-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.62rem 1.1rem;
    background: white;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-action-secondary:hover {
    background: #f5f3ff;
    border-color: #c7d2fe;
    color: #6366f1;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem 1rem;
    text-align: center;
}

.stat-value {
    font-size: 1.9rem;
    font-weight: 800;
    color: #6366f1;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
}

/* Result panel */
.tool-result {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.tool-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: #f8f9fc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
}

.tool-result-body { padding: 1rem 1.25rem; }

/* Single input panel */
.tool-single-panel {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
}

/* Form layout (two columns) */
.tool-form-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.tool-form-panel {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.tool-form-panel-header {
    padding: 0.7rem 1.25rem;
    background: #f8f9fc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tool-form-panel-body { padding: 1.25rem; }

/* Form elements */
.form-group { margin-bottom: 1.1rem; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.35rem;
}

.form-control-tool {
    display: block;
    width: 100%;
    padding: 0.5rem 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: white;
    font-size: 0.88rem;
    color: #0f172a;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control-tool:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.form-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

/* Select / input / range */
.tool-select, .tool-input {
    padding: 0.4rem 0.7rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 0.85rem;
    color: #0f172a;
    outline: none;
}

.tool-select:focus, .tool-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* Checkbox group */
.tool-checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #0f172a;
    cursor: pointer;
}

.tool-checkbox-group input[type=checkbox] { accent-color: #6366f1; }

/* Alerts */
.tool-alert {
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

.tool-alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.tool-alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.tool-alert-info    { background: #f0f9ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Code preview */
.code-preview {
    background: #1e293b;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 0.8rem;
    color: #e2e8f0;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 420px;
    overflow-y: auto;
}

/* Buttons grid (for case converter etc.) */
.btn-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-option {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: white;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-option:hover {
    background: #f5f3ff;
    border-color: #c7d2fe;
    color: #6366f1;
}

.btn-option.active {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

/* Strength bar */
.strength-bar {
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    margin: 0.5rem 0;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s, background 0.3s;
}

/* Hash output row */
.hash-row {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.hash-row:last-child { border-bottom: none; }

.hash-algo {
    font-size: 0.78rem;
    font-weight: 700;
    color: #6366f1;
    background: #f4f3ff;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-align: center;
}

.hash-value {
    font-family: Consolas, monospace;
    font-size: 0.78rem;
    color: #374151;
    word-break: break-all;
}

/* Color swatch */
.color-swatch {
    width: 100%;
    height: 120px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .tool-breadcrumb { padding: 0.75rem 1rem; }
    .tool-header { padding: 1rem; }
    .tool-body { padding: 1rem 1rem 3rem; }

    .tool-panels {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .panel-divider {
        width: 100%;
        height: 44px;
        flex-direction: row;
        border-left: none;
        border-right: none;
        border-top: 1px solid #e2e8f0;
        border-bottom: 1px solid #e2e8f0;
    }

    .tool-form-layout { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
