/* EDE Global Stylesheet */
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #f4f7f6; margin: 0; padding: 0; display: flex; flex-direction: row; min-height: 100vh; }

/* Sidebar Styles */
.sidebar { width: 280px; background-color: #2c3e50; color: white; position: fixed; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; box-shadow: 2px 0 5px rgba(0,0,0,0.1); z-index: 100; }
.sidebar-header { padding: 20px; background-color: #1a252f; text-align: center; }
.sidebar-header h2 { margin: 0; font-size: 1.5rem; color: #ecf0f1; border: none; }
.sidebar-nav { padding: 20px 0; flex-grow: 1; }
.sidebar-nav ul { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li { border-bottom: 1px solid #34495e; }
.sidebar-nav a { display: block; cursor: pointer; padding: 15px 25px; color: #bdc3c7; text-decoration: none; transition: all 0.3s; font-weight: 500; }
.sidebar-nav a:hover, .sidebar-nav a.active { background-color: #2980b9; color: white; padding-left: 30px; }
.sidebar-nav .sub-menu { background-color: #243342; display: none; }
.sidebar-nav li.open .sub-menu { display: block; }
.sidebar-nav .sub-menu a { padding: 10px 25px 10px 40px; font-size: 0.9em; }

/* Main Content Styles */
.main-content { margin-left: 280px; flex-grow: 1; display: flex; flex-direction: column; width: calc(100% - 280px); min-height: 800px; }
.header { background-color: #2c3e50; color: white; padding: 20px; text-align: center; }
.header h1 { margin: 0; font-size: 2.4rem; color: white; }
.header p { color: #ecf0f1; margin: 10px 0 0 0; font-size: 1.1rem; }

.container { display: flex; padding: 20px; flex: 1; box-sizing: border-box; justify-content: center; align-items: flex-start; }

/* Split Panels (Hub / Data Entry) */
.left-panel { flex: 1; height: 750px; overflow-y: auto; align-self: flex-start; margin: auto 10px auto 0; padding: 30px; display: flex; flex-direction: column; overflow-x: auto; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1), inset 0 -3px 0 rgba(0,0,0,0.05); transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); position: relative; border: 1px solid #eaeaea; }
.left-panel:hover { transform: translateY(-3px); box-shadow: 0 15px 35px rgba(0,0,0,0.12), inset 0 -3px 0 rgba(0,0,0,0.05); }
.left-panel::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px; border-radius: 12px 12px 0 0; background: linear-gradient(90deg, #3498db, #2980b9); }
.right-panel { flex: 1.2; height: 750px; overflow-y: auto; align-self: flex-start; margin: auto 0 auto 10px; padding: 30px; display: flex; flex-direction: column; overflow-x: auto; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1), inset 0 -3px 0 rgba(0,0,0,0.05); transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); position: relative; border: 1px solid #eaeaea; }
.right-panel:hover { transform: translateY(-3px); box-shadow: 0 15px 35px rgba(0,0,0,0.12), inset 0 -3px 0 rgba(0,0,0,0.05); }
.right-panel::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px; border-radius: 12px 12px 0 0; background: linear-gradient(90deg, #2ecc71, #27ae60); }

/* Full Panel (Theory / Analysis Output) */
.full-panel { flex: 1; padding: 40px; background-color: white; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); display: flex; flex-direction: column; overflow-x: auto; max-width: 1000px; width: 100%; margin: 0 auto; }

/* Typography & Elements */
h2, h3 { color: #2c3e50; border-bottom: 2px solid #2c3e50; padding-bottom: 10px; margin-top: 0; }
.center-heading { text-align: center; }
h4 { color: #2980b9; margin-top: 20px; }
p, li { line-height: 1.6; color: #555; text-align: justify; }

/* Tables */
table.pub-table { width: max-content; min-width: 50%; margin: 20px auto; border-collapse: collapse; margin: 20px 0; font-size: 0.95rem; border: 1px solid #ddd; font-family: 'Courier New', Courier, monospace; }
table.pub-table th, table.pub-table td { padding: 10px; text-align: left; border-bottom: 1px solid #ddd; }
table.pub-table th { background-color: #ecf0f1; font-weight: bold; color: #2c3e50; border-top: 2px solid #000; border-bottom: 1px solid #000; text-align: center; }
table.pub-table th:first-child:not([align="center"]) { text-align: left; }
table.pub-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid #ecf0f1; }
table.pub-table td:first-child:not([align="center"]) { text-align: left; font-weight: bold; color: #555; }
table.pub-table tr:last-child td { border-bottom: 2px solid #000; }
table.pub-table tr:hover { background-color: #f5f5f5; }

/* SAS Specific inside full-panel */
.sas-subtitle { color: #2980b9; font-weight: bold; font-size: 16px; margin-top: 30px; margin-bottom: 10px; text-align: left; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.sas-title { text-align: center; color: #2c3e50; font-size: 24px; font-weight: bold; border-bottom: 2px solid #2c3e50; padding-bottom: 10px; margin-bottom: 30px; }

/* Forms */
textarea, input[type="text"], input[type="number"] { width: 100%; border: 1px solid #ccc; border-radius: 4px; padding: 10px; box-sizing: border-box; font-family: monospace; resize: vertical; }
.btn-submit, .btn-cancel, .btn-copy, .btn-action { color: white; padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; font-weight: bold; margin-top: 15px; }
.btn-submit { background-color: #27ae60; } .btn-submit:hover { background-color: #2ecc71; }
.btn-cancel { background-color: #e74c3c; margin-left: 10px; } .btn-cancel:hover { background-color: #c0392b; }
.btn-copy { background-color: #2980b9; padding: 5px 10px; font-size: 12px; float: right; margin-top: 0; } .btn-copy:hover { background-color: #3498db; }
.btn-action { background-color: #7f8c8d; font-size: 14px; margin-top:0; margin-bottom: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); text-decoration:none; }

/* Posthoc */
.posthoc-container { margin-top: 20px; border-top: 1px solid #eee; padding-top: 15px; }
.posthoc-label { font-weight: bold; color: #2c3e50; display: block; margin-bottom: 12px; font-size: 14px; text-align: center; }
.posthoc-options { display: flex; justify-content: space-around; background: #f9f9f9; padding: 10px; border-radius: 6px; border: 1px solid #f0f0f0; }
.posthoc-options label { cursor: pointer; display: flex; align-items: center; gap: 5px; font-size: 13px; color: #555; }
.posthoc-options input[type="radio"] { cursor: pointer; margin: 0; }

/* Other modules/Hub */
.tier-grid { display: grid; grid-template-columns: 1fr; gap: 15px; margin-top: 20px; }
.tier-card { background-color: #f8f9fa; border-radius: 6px; padding: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); border-left: 5px solid #bdc3c7; transition: transform 0.2s; }
.tier-card:hover { transform: translateX(5px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.tier-card.active { border-left-color: #3498db; background-color: white; }
.tier-card h2 { margin: 0 0 10px 0; color: #2c3e50; font-size: 1.2rem; border: none; padding-bottom: 0; text-align: left; }
.tier-card p { margin-bottom: 15px; font-size: 0.95rem; }
.btn-launch { background-color: #3498db; color: white; padding: 8px 15px; border: none; border-radius: 4px; text-decoration: none; font-weight: bold; font-size: 14px; display: inline-block; }
.btn-launch:hover { background-color: #2980b9; }
.btn-disabled { background-color: #bdc3c7; color: white; cursor: not-allowed; }

.data-card { background-color: #f8f9fa; border: 1px solid #ddd; padding: 15px; border-radius: 5px; position: relative; margin-top: 10px; }
.data-card pre { font-family: monospace; font-size: 12px; max-height: 250px; overflow-y: auto; margin: 0; }
.badge { background-color: #3498db; color: white; padding: 3px 8px; border-radius: 12px; font-size: 12px; }
.help-link { color: #2c3e50; font-weight: bold; text-decoration: none; border: 1px solid #2c3e50; padding: 5px 10px; border-radius: 4px; display: inline-block; }
.help-link:hover { background-color: #2c3e50; color: white; }

.field-layout { display: grid; grid-template-columns: auto repeat(5, 1fr); gap: 10px; margin: 30px 0; background: #fff; padding: 20px; border: 1px solid #ccc; border-radius: 8px; overflow-x: auto; font-size: 13px; }
.plot { padding: 10px; text-align: center; border-radius: 4px; font-weight: bold; font-family: 'Consolas', monospace; border: 1px solid #ccc; }
.plot.check { background-color: #e3f2fd; color: #0277bd; }
.plot.test { background-color: #fbe9e7; color: #c62828; border-color: #ffab91; }
.block-label { display: flex; align-items: center; justify-content: center; font-weight: bold; background-color: #2c3e50; color: white; border-radius: 4px; padding: 5px; }

.footer { background-color: #2c3e50; color: #ecf0f1; padding: 15px; text-align: center; font-size: 13px; line-height: 1.5; margin-top: auto; }

@media print { .no-print { display: none !important; } body { background-color: #fff; } .full-panel { box-shadow: none; padding: 0; } .main-content { margin-left: 0; width: 100%; } }/* Hub Card Styles (Imported from AGSTAT1) */
.hub-header {
    background-color: #2c3e50;
    color: #fff;
    padding: 30px;
    text-align: center;
    border-bottom: 4px solid #e74c3c;
    margin: -20px -20px 20px -20px;
}
.hub-header h1 {
    margin: 0;
    font-size: 2.5rem;
    letter-spacing: 1px;
}
.hub-header p {
    margin: 10px 0 0 0;
    font-size: 1.1rem;
    color: #bdc3c7;
}
.group-title {
    color: #2c3e50;
    font-size: 1.8rem;
    border-bottom: 3px solid #e74c3c;
    padding-bottom: 10px;
    margin: 40px 20px 10px 20px;
}
.hub-container {
    max-width: 1200px;
    margin: 20px auto 40px auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 0 20px;
}
.card {
    background: #fff;
    border-radius: 12px;
    padding: 25px 20px 20px 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1), inset 0 -3px 0 rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    border: 1px solid #eaeaea;
    display: flex;
    flex-direction: column;
}
.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15), inset 0 -3px 0 rgba(0,0,0,0.05);
}
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    border-radius: 12px 12px 0 0;
}
.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: inline-block;
    transition: transform 0.3s ease;
}
.card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.card-1::before { background: linear-gradient(90deg, #3498db, #2980b9); }
.card-2::before { background: linear-gradient(90deg, #2ecc71, #27ae60); }
.card-3::before { background: linear-gradient(90deg, #9b59b6, #8e44ad); }
.card-4::before { background: linear-gradient(90deg, #f1c40f, #f39c12); }
.card-5::before { background: linear-gradient(90deg, #e67e22, #d35400); }
.card-6::before { background: linear-gradient(90deg, #1abc9c, #16a085); }
.card-7::before { background: linear-gradient(90deg, #e84393, #c0392b); }
.card-8::before { background: linear-gradient(90deg, #34495e, #2c3e50); }
.card-9::before { background: linear-gradient(90deg, #8e44ad, #2c3e50); }
.card-10::before { background: linear-gradient(90deg, #d35400, #c0392b); }

.card h2 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.4rem;
    font-weight: 800;
    border: none;
}
.card p {
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 35px;
    flex-grow: 1;
}
.card .btn-launch {
    display: inline-block;
    color: #fff;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    margin-top: auto;
}
.card .btn-launch:active {
    transform: translateY(2px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.card-1 .btn-launch { background: linear-gradient(135deg, #3498db, #2980b9); }
.card-1 .btn-launch:hover { background: linear-gradient(135deg, #2980b9, #2471a3); box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4); }
.card-2 .btn-launch { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.card-2 .btn-launch:hover { background: linear-gradient(135deg, #27ae60, #219a52); box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4); }
.card-3 .btn-launch { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.card-3 .btn-launch:hover { background: linear-gradient(135deg, #8e44ad, #732d91); box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4); }
.card-4 .btn-launch { background: linear-gradient(135deg, #f1c40f, #f39c12); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.card-4 .btn-launch:hover { background: linear-gradient(135deg, #f39c12, #d68910); box-shadow: 0 6px 20px rgba(241, 196, 15, 0.4); }
.card-5 .btn-launch { background: linear-gradient(135deg, #e67e22, #d35400); }
.card-5 .btn-launch:hover { background: linear-gradient(135deg, #d35400, #a04000); box-shadow: 0 6px 20px rgba(230, 126, 34, 0.4); }
.card-6 .btn-launch { background: linear-gradient(135deg, #1abc9c, #16a085); }
.card-6 .btn-launch:hover { background: linear-gradient(135deg, #16a085, #117864); box-shadow: 0 6px 20px rgba(26, 188, 156, 0.4); }
.card-7 .btn-launch { background: linear-gradient(135deg, #e84393, #c0392b); }
.card-7 .btn-launch:hover { background: linear-gradient(135deg, #c0392b, #922b21); box-shadow: 0 6px 20px rgba(232, 67, 147, 0.4); }
.card-8 .btn-launch { background: linear-gradient(135deg, #34495e, #2c3e50); }
.card-8 .btn-launch:hover { background: linear-gradient(135deg, #2c3e50, #1a252f); box-shadow: 0 6px 20px rgba(44, 62, 80, 0.4); }

/* --- RESPONSIVENESS & CENTERING --- */
/* Add flexbox to main-content to allow vertical centering */
.main-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Ensure the main container wrapper centers its content */
.main-content > .container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Prevent top-clipping on small screens */
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Mobile & Tablet adjustments */
@media (max-width: 992px) {
    body { flex-direction: column; }
    .sidebar { width: 100%; position: relative; height: auto; min-height: auto; box-shadow: 0 2px 5px rgba(0,0,0,0.1); z-index: 1000; }
    .main-content { margin-left: 0; width: 100%; }
    .container { flex-direction: column; padding: 10px; }
    .left-panel, .right-panel { width: 100%; margin: 0 0 20px 0; box-sizing: border-box; }
    .main-content > .container { align-items: flex-start; }
    .hub-container { grid-template-columns: 1fr !important; }
    .field-layout { grid-template-columns: 1fr; }
}

/* Tool Headers for Index pages */
.tool-header {
    max-width: 1160px;
    margin: 20px auto 10px auto;
    padding: 0 10px 15px 10px;
    background-color: transparent;
    text-align: left;
    border-bottom: 4px solid #e74c3c;
    position: relative;
    box-shadow: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tool-header h1 {
    margin: 0;
    font-size: 2.2rem;
    color: #2c3e50;
    letter-spacing: 1px;
    border: none;
    padding: 0;
    flex-grow: 1;
}
.tool-header .btn-theory {
    position: relative;
    background-color: #f1c40f;
    color: #2c3e50;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.2s;
    margin-right: 10px; /* Align with right panel */
}
.tool-header .btn-theory:hover {
    background-color: #f39c12;
    transform: translateY(-50%) scale(1.05);
}
@media (max-width: 992px) {
    .tool-header .btn-theory {
        position: static;
        transform: none;
        display: inline-block;
        margin-top: 15px;
    }
    .tool-header h1 {
        font-size: 1.8rem;
    }
}
