/* =====================================================
   OmixCalculator — Tool Page Shared Stylesheet
   Covers all common calculator UI styles shared
   across all 15 tool pages.
   Global base styles (header/footer/nav) are in style.css
   ===================================================== */

/* --- Page Header & Breadcrumbs --- */
.page-header { padding-top: 2px; padding-bottom: 1.5rem; }
.breadcrumbs { width: 100%; margin-bottom: 1rem; font-size: 0.9rem; color: var(--text-main); font-weight: 500; }
.breadcrumbs a { color: var(--primary); font-weight: 600; }
.breadcrumbs span { opacity: 0.6; margin: 0 6px; }
.breadcrumbs .current { opacity: 0.8; }

/* --- Typography (Tool Pages) --- */
h1 { font-size: 2.25rem; font-weight: 800; color: var(--text-heading); margin-bottom: 0.5rem; line-height: 1.2; letter-spacing: -0.03em; }
h2 { font-size: 1.5rem; font-weight: 700; color: var(--navy); margin: 2rem 0 1rem; letter-spacing: -0.02em; }
h3 { font-size: 1.15rem; font-weight: 600; color: var(--navy); margin: 1.5rem 0 0.8rem; }
.page-sub { font-size: 1.1rem; opacity: 0.8; max-width: 600px; }

/* --- Tool Layout Grid --- */
.tool-layout { display: grid; grid-template-columns: 380px 1fr; gap: 3rem; align-items: start; margin-bottom: 5rem; }

/* --- Tool Card --- */
.tool-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-float); border-top: 4px solid var(--primary); }

/* --- Mode Toggle --- */
.mode-toggle { display: flex; background: #F1F5F9; padding: 4px; border-radius: 8px; margin-bottom: 1rem; }
.mode-btn { flex: 1; border: none; background: none; padding: 8px; font-size: 0.9rem; font-weight: 700; color: var(--text-main); border-radius: 6px; cursor: pointer; transition: all 0.2s; }
.mode-btn.active { background: white; color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* --- Guide & History --- */
.guide-text { text-align: center; margin-bottom: 1.5rem; color: var(--primary); font-weight: 600; font-size: 0.85rem; }
.history-box { background: #EFF6FF; border: 1px dashed var(--primary); border-radius: 8px; padding: 15px; margin-bottom: 20px; display: none; }
.history-box.show { display: block; animation: slideDown 0.3s ease-out; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
.h-title { font-size: 0.75rem; font-weight: 700; color: var(--navy); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.h-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* --- Subject / Semester Rows --- */
.subject-row { background: #F8FAFC; border: 1px solid var(--border); padding: 12px; border-radius: 8px; margin-bottom: 12px; }
.subject-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.subject-title { font-size: 0.85rem; font-weight: 700; color: var(--primary); text-transform: uppercase; }
.remove-subject { background: none; border: none; color: #E11D48; font-size: 1.5rem; cursor: pointer; line-height: 1; padding: 0 8px; }
.subject-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 10px; }
.mini-input label { font-size: 0.75rem; font-weight: 600; color: var(--text-main); display: block; margin-bottom: 2px; }

/* --- Form Inputs --- */
.input-field { width: 100%; padding: 8px 10px; border: 1px solid #CBD5E1; border-radius: 4px; font-size: 0.95rem; font-family: inherit; background: white; transition: all 0.2s; }
.input-field:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); outline: none; }

/* --- Buttons --- */
.add-subject-btn { display: flex; justify-content: center; align-items: center; width: 100%; min-height: 48px; background: white; border: 1px dashed var(--primary); color: var(--primary); padding: 0; border-radius: 8px; font-weight: 600; cursor: pointer; margin-bottom: 1rem; transition: all 0.2s; }
.add-subject-btn:hover { background: #EFF6FF; }
.calc-btn { width: 100%; background: var(--primary); color: white; border: none; padding: 14px; font-size: 1.1rem; font-weight: 700; border-radius: 8px; cursor: pointer; transition: background 0.2s; }
.calc-btn:hover { background: var(--primary-dark); }

/* --- Result Box --- */
#result-box { display: none; margin-top: 1.5rem; background-color: #EFF6FF; border: 1px solid #BFDBFE; border-radius: 8px; padding: 1.5rem; text-align: center; }
.result-label { font-size: 0.85rem; text-transform: uppercase; font-weight: 700; color: var(--primary); letter-spacing: 0.05em; }
.result-value { font-size: 3rem; font-weight: 800; color: var(--navy); line-height: 1.2; margin: 0.5rem 0; }
.score-breakdown { display: flex; justify-content: center; gap: 1.5rem; margin-top: 1rem; border-top: 1px solid rgba(37, 99, 235, 0.2); padding-top: 1rem; }
.breakdown-item .label { display: block; font-size: 0.75rem; font-weight: 600; opacity: 0.8; }
.breakdown-item .value { display: block; font-size: 1.1rem; font-weight: 800; color: var(--navy); }
.reset-link { display: block; margin-top: 1rem; font-size: 0.85rem; color: #334155; text-decoration: underline; cursor: pointer; background: none; border: none; width: 100%; }

/* --- Content Area (Right Column) --- */
.content-area { color: var(--text-main); min-width: 0; }
.content-area p { margin-bottom: 1rem; font-size: 1.05rem; line-height: 1.7; }
.article-intro { font-size: 1.1rem; color: var(--text-heading); margin-bottom: 2rem; }

/* --- Info Boxes --- */
.grade-scale-box { background: #F8FAFC; border: 1px solid var(--border); border-radius: 8px; padding: 1.2rem; margin-bottom: 2rem; }
.grade-scale-title { font-size: 0.95rem; font-weight: 700; color: var(--navy); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.grade-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.grade-table th { text-align: left; padding: 6px; border-bottom: 2px solid var(--border); color: var(--primary); font-size: 0.8rem; text-transform: uppercase; }
.grade-table td { padding: 6px; border-bottom: 1px solid var(--border); color: var(--text-main); font-weight: 500; }
.grade-table tr:last-child td { border-bottom: none; }
.toc-box { background: #fff; border: 1px solid var(--border); padding: 1.5rem; margin-bottom: 2.5rem; border-radius: 4px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.toc-title { font-size: 0.95rem; font-weight: 700; color: var(--navy); margin-bottom: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
.toc-list { list-style: none; }
.toc-list li { margin-bottom: 8px; }
.toc-list a { font-size: 0.95rem; color: var(--primary); font-weight: 500; transition: all 0.2s; }
.toc-list a:hover { text-decoration: underline; color: var(--primary-dark); }
.formula-box { background: #EFF6FF; border-left: 4px solid var(--primary); padding: 1.5rem; margin: 1.5rem 0; border-radius: 0 8px 8px 0; }
.example-box { background: #F0FDF4; border-left: 4px solid #16A34A; padding: 1.5rem; margin: 1.5rem 0; border-radius: 0 8px 8px 0; }
.note-box { background: #FFFBEB; border-left: 4px solid #F59E0B; padding: 1.5rem; margin: 1.5rem 0; border-radius: 0 8px 8px 0; color: #4B5563; }
.note-box strong { color: #B45309; }
.feature-list-plain { line-height: 1.8; margin-bottom: 2rem; padding-left: 1.5rem; }
.feature-list-plain strong { color: var(--navy); }

/* --- FAQ Section (Tool Pages - Simple List) --- */
.faq-section { margin-top: 2rem; }
.faq-section h2 { font-size: 1.5rem; font-weight: 700; color: var(--navy); margin-bottom: 1rem; }
.faq-section h3 { font-size: 1rem; font-weight: 700; color: var(--navy); margin: 1.25rem 0 0.4rem; }
.faq-section p { font-size: 0.97rem; color: var(--text-main); margin: 0; }

/* --- Math Formula Styles --- */
.math-block { display: flex; align-items: center; gap: 10px; font-family: 'Times New Roman', Times, serif; font-size: 1.2rem; margin: 10px 0; overflow-x: auto; }
.fraction { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; }
.fraction-top { border-bottom: 1px solid black; padding: 0 5px 2px; }
.fraction-bottom { padding: 2px 5px 0; }

/* --- Mobile Overrides (Tool Pages) --- */
@media (max-width: 768px) {
    .tool-layout { grid-template-columns: 1fr; gap: 2rem; }
    h1 { font-size: 1.75rem; }
    .faq-wrapper { grid-template-columns: 1fr; }
}
