/* =========================================================
   Shared Tool Page Styles — saisaritamia.com
   ========================================================= */

.tool-page-wrapper {
    max-width: 860px;
    margin: 0 auto;
    font-family: inherit;
}

/* ---- Tool Card ---- */
.tool-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 28px 32px;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* ---- Inputs ---- */
.tool-card label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    font-size: 14px;
}

.tool-card input[type="text"],
.tool-card input[type="number"],
.tool-card input[type="date"],
.tool-card select,
.tool-card textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    margin-bottom: 14px;
    box-sizing: border-box;
    transition: border-color .2s;
}

.tool-card input:focus,
.tool-card select:focus,
.tool-card textarea:focus {
    outline: none;
    border-color: #0073aa;
}

.tool-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.tool-row .tool-field {
    flex: 1;
    min-width: 160px;
}

/* ---- Buttons ---- */
.tool-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 11px 28px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    margin-right: 8px;
    margin-bottom: 8px;
}
.tool-btn:hover { background: #005a87; }
.tool-btn.secondary {
    background: #6c757d;
}
.tool-btn.secondary:hover { background: #545b62; }

/* ---- Result ---- */
.tool-result {
    background: #f0f8ff;
    border: 1px solid #b8d4e8;
    border-radius: 6px;
    padding: 18px 22px;
    margin-top: 18px;
    font-size: 16px;
    display: none;
}
.tool-result.show { display: block; }
.tool-result .result-value {
    font-size: 22px;
    font-weight: 700;
    color: #0073aa;
    display: block;
    margin-bottom: 4px;
}
.tool-result .result-label {
    font-size: 13px;
    color: #666;
}

.tool-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 12px 18px;
    margin-top: 14px;
    color: #856404;
    display: none;
}
.tool-error.show { display: block; }

/* ---- Conversion Table ---- */
.conv-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
    font-size: 14px;
}
.conv-table th {
    background: #0073aa;
    color: #fff;
    padding: 10px 14px;
    text-align: left;
}
.conv-table td {
    padding: 9px 14px;
    border-bottom: 1px solid #eee;
}
.conv-table tr:nth-child(even) td { background: #f9f9f9; }
.conv-table .val-cell {
    font-weight: 600;
    color: #0073aa;
}

/* ---- Multi-result grid ---- */
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 18px;
}
.result-grid-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px 16px;
    text-align: center;
}
.result-grid-item .rg-val {
    font-size: 18px;
    font-weight: 700;
    color: #0073aa;
    display: block;
}
.result-grid-item .rg-unit {
    font-size: 12px;
    color: #666;
}

/* ---- SEO Article Content ---- */
.tool-seo-content {
    margin-top: 40px;
    border-top: 1px solid #eee;
    padding-top: 32px;
}
.tool-seo-content h2 {
    font-size: 22px;
    margin-bottom: 12px;
    color: #222;
}
.tool-seo-content h3 {
    font-size: 18px;
    margin-top: 24px;
    margin-bottom: 8px;
    color: #333;
}
.tool-seo-content p {
    line-height: 1.75;
    color: #444;
    margin-bottom: 14px;
}
.tool-seo-content ul, .tool-seo-content ol {
    padding-left: 22px;
    margin-bottom: 14px;
    line-height: 1.75;
    color: #444;
}
.faq-item {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    margin-bottom: 10px;
    overflow: hidden;
}
.faq-question {
    background: #f5f5f5;
    padding: 13px 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}
.faq-question:after { content: '+'; font-size: 20px; color: #0073aa; }
.faq-item.open .faq-question:after { content: '−'; }
.faq-answer {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, padding .3s;
    font-size: 14px;
    line-height: 1.7;
    color: #555;
}
.faq-item.open .faq-answer {
    max-height: 400px;
    padding: 14px 18px;
}

/* Scientific calc display */
.sci-display {
    background: #1a1a2e;
    color: #00ff88;
    font-family: 'Courier New', monospace;
    font-size: 24px;
    text-align: right;
    padding: 16px 20px;
    border-radius: 6px;
    margin-bottom: 14px;
    min-height: 60px;
    word-break: break-all;
}
.calc-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}
.calc-btn {
    padding: 14px;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
    background: #e9ecef;
    color: #333;
}
.calc-btn:hover { opacity: .85; }
.calc-btn.op { background: #0073aa; color: #fff; }
.calc-btn.eq { background: #28a745; color: #fff; grid-column: span 2; }
.calc-btn.fn { background: #6f42c1; color: #fff; }
.calc-btn.clear { background: #dc3545; color: #fff; }

/* Color preview */
.color-preview-box {
    width: 100%;
    height: 80px;
    border-radius: 6px;
    border: 1px solid #ccc;
    margin-top: 10px;
    margin-bottom: 14px;
    transition: background .3s;
}

/* ---- Tools Hub & Category Listing Pages ---- */
.tools-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin: 20px 0;
}
.tools-hub-card {
    display: block;
    padding: 18px 20px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .18s, border-color .18s;
}
.tools-hub-card:hover {
    border-color: #0073aa;
    box-shadow: 0 3px 10px rgba(0,115,170,.15);
    text-decoration: none;
}
.tools-hub-card strong {
    display: block;
    font-size: 15px;
    color: #0073aa;
    margin-bottom: 6px;
}
.tools-hub-card p {
    font-size: 13px;
    color: #666;
    margin: 0 0 8px;
    line-height: 1.5;
}
.hub-count {
    font-size: 12px;
    background: #0073aa;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
}
.tools-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 10px;
    margin: 12px 0 20px;
}
.tool-link-card {
    display: block;
    padding: 11px 15px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
    font-size: 13.5px;
    transition: background .15s, color .15s;
}
.tool-link-card:hover {
    background: #0073aa;
    color: #fff;
    text-decoration: none;
}
.category-section {
    margin: 26px 0 0;
    padding-top: 22px;
    border-top: 1px solid #f0f0f0;
}
.category-section h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #222;
}
.category-section h3 a { color: #0073aa; text-decoration: none; }
.category-section h3 a:hover { text-decoration: underline; }
.category-section .cat-desc { font-size: 13px; color: #777; margin: 0 0 10px; }
.back-to-tools {
    display: inline-block;
    margin-bottom: 18px;
    font-size: 13px;
    color: #0073aa;
    text-decoration: none;
}
.back-to-tools:hover { text-decoration: underline; }

@media (max-width: 600px) {
    .tool-card { padding: 18px 16px; }
    .tool-row { flex-direction: column; gap: 0; }
    .calc-buttons { grid-template-columns: repeat(4, 1fr); }
    .calc-btn.eq { grid-column: span 1; }
    .tools-hub-grid { grid-template-columns: 1fr 1fr; }
    .tools-index-grid { grid-template-columns: 1fr 1fr; }
}
