 
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #394453;
    padding: 20px;
    min-height: 100vh;
}
/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
/* Heading */
h1 {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}
.subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 40px;
    font-size: 0.95rem;
}
/* Instructions Button */
#openInstructions {
    background-color: #2c3e50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    margin-bottom: 20px;
    float: right;
}
#openInstructions:hover {
    background-color: #040f19;
}
/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}
.modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 25px 30px;
    border: none;
    width: 95%;
    max-width: 700px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    animation: slideIn 0.3s ease;
    box-sizing: border-box;
    max-height: 90vh;
    overflow-y: auto;
}
.close {
    color: #444;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
    margin-top: -10px;
}
.close:hover {
    color: #e53935;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
/* Headings */
h2 {
    color: #34495e;
    margin-bottom: 20px;
    font-size: 1.2rem;
    padding: 12px 20px;
    background-color: #ecf0f1;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}
/* Input rows */
.input-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
label {
    color: #555;
    font-weight: 500;
    min-width: 200px;
}
input[type="number"] {
    padding: 10px 15px;
    border: 2px solid #dfe6e9;
    border-radius: 6px;
    font-size: 14px;
    width: 250px;
    transition: border-color 0.3s;
}
input[type="number"]:focus {
    outline: none;
    border-color: #3498db;
}
/* Buttons */
button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
}
button:hover {
    background-color: #2980b9;
}
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}
.button-secondary {
    background-color: #1f2e3e;
}
.button-secondary:hover {
    background-color: #1f2e3e;
}
/* Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 20px;
}
table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    min-width: max-content;
}
th, td {
    border: 1px solid #dfe6e9;
    padding: 12px;
    text-align: center;
    white-space: nowrap;
}
th {
    background-color: #34495e;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}
tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}
tbody tr:hover {
    background-color: #e8f4f8;
}
td input {
    width: 100%;
    min-width: 60px;
    padding: 6px;
    border: 1px solid #dfe6e9;
    border-radius: 4px;
    text-align: center;
    box-sizing: border-box;
}
/* Result containers */
#lineTableContainer,
#measTableContainer,
#resultContainer,
#resultnondiagonal,
#resultdiagonal,
#ybusContainer {
    margin-top: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
/* Footer */
footer {
    text-align: center;
    padding: 10px;
    margin-top: 30px;
    margin-left: -40px;
    margin-right: -40px;
    margin-bottom: -42px;
    background-color: #466581;
    color: white;
    border-radius: 0 0 12px 12px;
    font-size: 16px;
}
/* Flex Layout for Columns */
.flex-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 20px;
    clear: both;
}
.column {
    flex: 1;
    padding: 20px;
    box-sizing: border-box;
    border-right: 1px solid #ddd;
    overflow-x: auto;
}
.column:last-child {
    border-right: none;
}
/* Full width section for contingency analysis */
.full-width-section {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    margin-top: 20px;
    clear: both;
}
hr {
    border: none;
    height: 1px;
    background-color: #dfe6e9;
    margin: 20px 0;
}
/* Responsive Adjustments */
@media (max-width: 768px) {
    .input-row {
        flex-direction: column;
        align-items: stretch;
    }
    label {
        min-width: auto;
    }
    input[type="number"] {
        width: 100%;
    }
    .button-group {
        flex-direction: column;
    }
    button {
        width: 100%;
    }
    .flex-container {
        flex-direction: column;
    }
    .column {
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
    .column:last-child {
        border-bottom: none;
    }
    th, td {
        padding: 8px 4px;
        font-size: 0.8rem;
    }
}
@media (max-width: 480px) {
    .container {
        padding: 20px;
    }
}
 