body {
    background: #f7f8fa;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    flex-direction: column;
    padding: 15px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 16px;
    margin-bottom: 30px;
}

.nav {
    display: flex;
    width: 100%;
    padding: 0 10px;
    align-items: center;
}

.nav-link {
    color: white;
}

/* Matrix Display Styles */
.matrix-display {
    margin: 20px 0;
}

.results-display {
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.matrix-result {
    margin: 10px auto;
    border-collapse: collapse;
    background: white;
}

.matrix-result td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: center;
}

.vector-result {
    margin: 10px auto;
    border-collapse: collapse;
    background: white;
}

.vector-result td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: center;
}

.eigen-results {
    padding: 20px;
}

.eigen-results h3 {
    color: #4a5568;
    margin-bottom: 12px;
}

.eigen-results h4 {
    color: #718096;
    margin: 16px 0 8px;
}

.eigen-results ul {
    list-style-type: none;
    padding-left: 0;
}

.eigen-results li {
    margin: 8px 0;
    font-family: "Courier New", monospace;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background 0.3s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
}

.content {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.section {
    margin-bottom: 30px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.matrix-tool-panel {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    margin-top: 20px;
}

.matrix-tool-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: start;
}

.matrix-tool-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.matrix-tool-subtitle {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.matrix-dimension-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.matrix-tool-panel .input-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.matrix-tool-panel .input-group label {
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
}

.matrix-tool-panel .input {
    width: 100%;
    max-width: 110px;
}

.matrix-tool-panel .select {
    width: 100%;
    min-width: 0;
}

.matrix-tool-buttons {
    gap: 12px;
}

.matrix-tool-button-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.matrix-tool-button-wrap .btn {
    flex: 1 1 auto;
    min-width: 160px;
    text-align: center;
}

@media (min-width: 640px) {
    .matrix-tool-button-wrap {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.matrix-scalar-field {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.matrix-scalar-field label {
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
}

.matrix-error {
    margin-top: 10px;
    color: #dc2626;
    font-weight: 600;
    min-height: 20px;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input {
    width: 60px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

.select {
    padding: 8px 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    min-width: 200px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-secondary {
    background: #764ba2;
    color: white;
}

.header h1 {
    color: white;
    margin: 0;
}

.label-bold {
    font-weight: bold;
}

h2 {
    color: #764ba2;
    margin-bottom: 18px;
}

p {
    font-size: 18px;
    color: #333;
    margin-bottom: 24px;
}

/* Matrix Display Formatting */
pre {
    font-family: 'Courier New', 'Consolas', monospace;
    line-height: 1.6;
    letter-spacing: 0.05em;
}

.matrix-notation {
    display: inline-block;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 16px;
    line-height: 2.0;
    padding: 20px 28px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: left;
    white-space: pre;
    border: 1px solid #e5e7eb;
    letter-spacing: 0.15em;
}

.matrix-notation.note {
    background: #fff8e6;
    color: #92400e;
    font-size: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.matrix-notation.accent-blue {
    background: #e0f2fe;
    border-color: #bfdbfe;
}

.matrix-notation.accent-yellow {
    background: #fef3c7;
    border-color: #fde68a;
}

.matrix-example {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin: 16px 0;
}

.matrix-example pre {
    margin: 0;
    background: white;
    padding: 16px;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.8;
}
