/* General body styling */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Overall app container layout */
.app-container {
    display: flex;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    border: 1px solid #ccc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

/* Navigation panel styling */
.nav-panel {
    width: 200px;
    background-color: #fff;
    padding: 20px;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.nav-panel h2 {
    margin-top: 0;
    color: #333;
    font-size: 1.5rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.nav-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    text-align: left;
    transition: background-color 0.3s ease;
}

.nav-button:hover {
    background-color: #2980b9;
}

/* Main content area styling */
.main-content {
    flex: 1;
    padding: 20px;
    background-color: #ffffff;
    overflow-y: auto;
    overflow-x: hidden;
}

.main-content h1 {
    color: #2c3e50;
    border-bottom: 2px solid #bdc3c7;
    padding-bottom: 10px;
}

.main-content p {
    color: #7f8c8d;
}

/* Subject page layout */
.subject-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    overflow-x: hidden;
}

.subject-page>div {
    min-width: 0;
    /* Ensure columns respect equal width */
}

/* Ensure tables don't cause horizontal overflow */
table {
    max-width: 100%;
    table-layout: auto;
    overflow-wrap: break-word;
}

/* Formula list styling */
.formula-topic {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 8px;
    background-color: #ecf0f1;
}

.formula-topic h3 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 1px solid #bdc3c7;
    padding-bottom: 5px;
}

.formula-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
}

.formula-item .-container {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    height: 100%;
}

.formula-details {
    flex-grow: 1;
}

.formula-details span {
    font-size: 14px;
    line-height: 1.5;
}

.formula {
    font-family: 'Cambria Math', 'Latin Modern Math', serif;
    font-size: 1.1rem;
    font-weight: bold;
    color: #2980b9;
}

.formula-description {
    color: #555;
    font-size: 0.9rem;
}

.constants {
    color: #7f8c8d;
    font-style: italic;
    font-size: 0.85rem;
}

.separator {
    color: #999;
    font-weight: bold;
}

.cheat-sheet-btn-container {
    text-align: center;
    margin-top: 20px;
}

.create-cheat-sheet-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.create-cheat-sheet-btn:hover {
    background-color: #219d53;
}