/*
Theme Name: TradMaths
Theme URI: https://example.com/TradMaths
Author: Math Notebook Solver
Description: Universal Step-by-Step Math Solver Theme with multi-input support and notebook alignment.
Version: 1.0
Text Domain: mathstep
*/

* {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    box-sizing: border-box;
}

body {
    background-color: #090d16;
    color: #f3f4f6;
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.paper-bg {
    background-image: 
        linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
    background-size: 28px 28px;
}

/* Matching Theme Navigation Bar */
.mathstep-navbar {
    background-color: #111827;
    border-bottom: 1px solid #1f2937;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: #38bdf8;
    color: #030712;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: #9ca3af;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover, .nav-link.active {
    background-color: #030712;
    color: #38bdf8;
    border-color: #1f2937;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 16px;
    flex: 1;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 1024px) {
    .grid-2 {
        grid-template-columns: repeat(12, 1fr);
    }
    .col-5 { grid-column: span 5; }
    .col-7 { grid-column: span 7; }
    .col-6 { grid-column: span 6; }
}

.card {
    background-color: #111827;
    border: 1px solid #1f2937;
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn {
    background-color: #38bdf8;
    color: #030712;
    font-weight: 700;
    padding: 12px 16px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s;
}
.btn:hover { background-color: #7dd3fc; }

.btn-secondary {
    background-color: #030712;
    color: #f3f4f6;
    border: 1px solid #1f2937;
    cursor: pointer;
}
.btn-secondary:hover { background-color: #1f2937; }

input {
    width: 100%;
    padding: 10px 12px;
    background-color: #030712;
    border: 1px solid #1f2937;
    color: #fff;
    border-radius: 12px;
    font-family: 'Fira Code', monospace;
    font-size: 16px;
    outline: none;
}
input:focus { border-color: #38bdf8; }

.add-table, .sub-table, .mul-table, .div-table {
    font-family: 'Fira Code', 'Courier New', monospace;
    border-collapse: collapse;
    margin: 0 auto;
    user-select: none;
}

.add-table td, .sub-table td, .mul-table td {
    width: 1.3rem;
    height: 2.2rem;
    text-align: center;
    vertical-align: middle;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 0;
}

.div-table td {
    width: 1.35rem;
    height: 1.9rem;
    text-align: center;
    vertical-align: middle;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 0;
}

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

.addend-row { margin-bottom: 12px; }
.addend-row label { display: block; font-size: 11px; font-weight: bold; color: #9ca3af; text-transform: uppercase; margin-bottom: 4px; }

.mathstep-footer {
    margin-top: auto;
    text-align: center;
    font-size: 12px;
    color: #6b7280;
    padding: 16px 12px 24px;
    border-top: 1px solid #1f2937;
}
.mathstep-footer p { margin: 0; }

.site-header {
    text-align: center;
    margin-bottom: 30px;
}

.site-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(14, 116, 144, 0.35);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.site-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 2rem;
    margin: 0 0 8px 0;
    color: #fff;
}

.site-title span { color: #38bdf8; }

.site-subtitle {
    color: #9ca3af;
    font-size: 14px;
    margin: 0;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.solver-card {
    background-color: #111827;
    border: 1px solid #1f2937;
    border-radius: 20px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.solver-card:hover {
    border-color: #38bdf8;
    transform: translateY(-4px);
    box-shadow: 0 10px 20px -5px rgba(56, 189, 248, 0.15);
}

.card-icon-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

.card-icon.addition { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.card-icon.subtraction { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.card-icon.multiplication { background: rgba(192, 132, 252, 0.15); color: #c084fc; }
.card-icon.division { background: rgba(52, 211, 153, 0.15); color: #34d399; }

.solver-card h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #fff;
    font-family: 'Fredoka', sans-serif;
}

.solver-card p {
    margin: 0;
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .mathstep-navbar {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    .navbar-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 4px;
    }
    .nav-link {
        padding: 6px 10px;
        font-size: 12px;
    }
}