:root {
    --header-height: 9rem;
    --nav-height: 3rem;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f4f9;
    color: #333;
}

header {
    /* background: #4a90e2; */
    background: linear-gradient(30deg, rgb(60, 133, 215), rgb(74, 144, 226));
    color: white;
    padding: 1rem 0;
    text-align: center;
    box-shadow: 0.125rem 0.125rem 0.3125rem rgba(0,0,0,0.2);
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    box-sizing: border-box;
}

header h1 {
    margin: 0;
}

/* Navigation styling */
nav {
    background: linear-gradient(30deg, rgb(65, 138, 220), rgb(79, 149, 231));
    padding: 0.6rem 0;
    text-align: center;
    box-shadow: 0 0.2rem 0.25rem rgba(0,0,0,0.1);
    position: fixed;
    top: var(--header-height);
    width: 100%;
    height: var(--nav-height);
    z-index: 999;
    box-sizing: border-box;
}

nav a {
    color: white;
    text-decoration: none;
    margin: 0 1rem;
    padding: 0.3rem 0.6rem;
    border-radius: 0.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0.2 0.25rem rgba(255, 255, 255, 0.5);
}

nav a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Table styles for decomposition.html */
.decomposition-table {
    border-collapse: collapse;
    margin: 1rem 0;
}

.math-formula {
    margin: 1.5rem 0;
    text-align: center;
}

/* These styles below are kept for backward compatibility but may be removed later */
.formula-table {
    border-collapse: separate;
    border-spacing: 0;
    margin: 1rem 0;
}

.formula-table td {
    padding: 0.3rem;
    vertical-align: middle;
}

.formula-nested-table {
    width: 100%;
}

.formula-nested-table td {
    text-align: center;
    padding: 0.3rem;
}

.formula-nested-table hr {
    border: 1px solid black;
    width: 100%;
    margin: 0.2rem 0;
}

.decomposition-bordered-table {
    border-collapse: separate;
    border-spacing: 0.5rem 0.5rem;
    margin: 1rem 0;
}

.decomposition-bordered-table td {
    border: 0.05rem solid black;
    padding: 0.3rem;
}

/* Default table styles */
.default-table {
    border-collapse: collapse;
    margin: 1rem 0;
    width: 100%;
}

.default-table th, .default-table td {
    border: 0.05rem solid black;
    padding: 0.5rem;
    text-align: left;
}

.default-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

/* Specific table styles for Path-Command-Description tables */
.path-command-description-table {
    border-collapse: collapse;
    margin: 1rem 0;
    width: 100%;
    table-layout: fixed;
}

.path-command-description-table th, .path-command-description-table td {
    border: 0.05rem solid black;
    padding: 0.5rem;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

.path-command-description-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.path-command-description-table th:nth-child(1),
.path-command-description-table td:nth-child(1) {
    width: 25%;
}

.path-command-description-table th:nth-child(2),
.path-command-description-table td:nth-child(2) {
    width: 25%;
}

.path-command-description-table th:nth-child(3),
.path-command-description-table td:nth-child(3) {
    width: 50%;
}

/* Legacy style - will be removed after HTML updates */
.bordered-table {
    border-collapse: collapse;
    margin: 1rem 0;
}

.bordered-table td, .bordered-table th {
    border: 0.05rem solid black;
    padding: 0.3rem;
}

main {
    padding: 1.2rem;
    margin-top: calc(var(--header-height) + var(--nav-height));
}

.section1 {
    /* background: rgb(255, 255, 255); */
    background: linear-gradient(30,rgb(240, 240, 240),rgb(255, 255, 255));
    margin-bottom: 1.2rem;
    padding: 1.2rem;
    border-radius: 0.5rem;
    box-shadow: 0.1rem 0.1rem 0.3rem rgba(0,0,0,0.2);
}

h2 {
    color: #4a90e2;
    margin: 0;
}

p {
    margin-top: 1rem;
    margin-bottom: 0.3rem;
}

.standardsection {
    margin-bottom: 1.2em;
    padding: 1rem;
    border: 0.05rem solid #e0e0e0;
    border-radius: 0.3rem;
}

form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

input, textarea, button {
    padding: 0.6rem;
    border: 0.05rem solid #ccc;
    border-radius: 0.2rem;
}

button {
    background-color: #4a90e2;
    color: white;
    cursor: pointer;
}

button:hover {
    background-color: #3a7bdf;
}
