/* /app/static/app/css/main.css */

/* === Variables & Global Reset === */
:root {
  --primary-color: #313b77;
  --primary-color-dark: #242c5a;
  --primary-color-light: #eaf0ff;
  --grey-100: #f8f9fa;
  --grey-200: #e9ecef;
  --grey-300: #dee2e6;
  --grey-700: #495057;
  --grey-900: #212529;
  --danger-color: #dc3545;
  --danger-color-light: #f8d7da;
  --danger-color-dark: #721c24;
  --body-font: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --base-font-size: 16px;
  --border-radius: 6px;
  --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --transition-speed: 0.2s ease;
  --header-height: 60px;
  --nav-width: 240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--body-font);
  font-size: var(--base-font-size);
  line-height: 1.6;
  background-color: var(--grey-100);
  color: var(--grey-700);
}
h1, h2, h3, h4, h5, h6 { color: var(--grey-900); margin-bottom: 0.75em; line-height: 1.3; font-weight: 500; }
a { color: var(--primary-color); text-decoration: none; transition: color var(--transition-speed); }
a:hover { color: var(--primary-color-dark); }
ul { list-style: none; }

/* === Main Layout (Sidebar Version) === */
#header {
    position: fixed;
    top: 0;
    left: var(--nav-width);
    width: calc(100% - var(--nav-width));
    height: var(--header-height);
    background-color: #fff;
    border-bottom: 1px solid var(--grey-300);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between; /* MODIFIED */
    padding: 0 30px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 25px;
}
.header-actions { /* NEW */
    display: flex;
    align-items: center;
}

.header-logout-link {
    color: var(--grey-700);
    font-size: 0.9em;
    font-weight: 500;
}
.header-logout-link:hover { color: var(--primary-color); }

#navigation {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--nav-width);
    height: 100vh;
    background-color: #ffffff;
    border-right: 1px solid var(--grey-300);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.sidebar-header {
    padding: 0 25px;
    margin-bottom: 25px;
}
.sidebar-logo {
    max-width: 100%;
    height: auto;
}

#main {
    margin-left: var(--nav-width);
    margin-top: var(--header-height);
    padding: 30px;
    min-height: calc(100vh - var(--header-height));
}

body.auth-page #main {
    margin-left: 0;
    margin-top: 0;
}
body.auth-page #header, body.auth-page #navigation {
    display: none;
}

/* === Sidebar Navigation Styles === */
.main-nav-list {
    padding: 0 15px;
    flex-grow: 1; /* NEW: Pushes footer down */
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    margin-bottom: 5px;
    font-size: 1em;
    font-weight: 500;
    color: var(--grey-700);
    border-radius: var(--border-radius);
    transition: background-color var(--transition-speed), color var(--transition-speed);
}
.nav-link .fa-fw {
    width: 1.25em;
    font-size: 1.1em;
}
.nav-link:hover {
    background-color: var(--grey-100);
    color: var(--primary-color);
}
.nav-link.active {
    background-color: var(--primary-color-light);
    color: var(--primary-color);
    font-weight: 700;
}

/* === NEW: Inline Sub-navigation Styles === */
.sub-nav-list-inline {
    padding-left: 52px;
    margin-top: -5px;
    margin-bottom: 10px;
}
.sub-nav-list-inline li {
    margin-bottom: 4px;
    font-size: 0.9em;
}
.sub-nav-list-inline a {
    color: var(--grey-700);
    font-weight: 400;
}
.sub-nav-list-inline a.active {
    color: var(--primary-color-dark);
    font-weight: 700;
}

/* === NEW: Sidebar Footer for Reset Button === */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--grey-200);
}
.btn-danger-outline {
    width: 100%;
    background-color: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color-light);
}
.btn-danger-outline:hover {
    background-color: var(--danger-color-light);
    color: var(--danger-color-dark);
}


/* === Login/Register & Table Styles === */
.auth-page-wrapper { display: flex; justify-content: center; align-items: center; width: 100%; min-height: 100vh; padding: 20px; }
.login-card, .register-card { width: 100%; max-width: 420px; text-align: center; }
.login-logo { max-width: 250px; height: auto; margin-bottom: 25px; }
.project-list-table { width: 100%; border-collapse: collapse; margin-top: 15px; font-size: 0.95em; }
.project-list-table thead tr { border-bottom: 2px solid var(--grey-300); }
.project-list-table th { text-align: left; padding: 12px 10px; color: var(--grey-700); font-weight: 500; background-color: var(--grey-100); }
.project-list-table tbody tr { border-bottom: 1px solid #eee; }
.project-list-table td { padding: 14px 10px; vertical-align: middle; }
.project-list-table td a { color: var(--primary-color); font-weight: 500; }
.analysis-status { font-style: italic; color: #6c757d; }

/* === Header Asset Selector === */
.asset-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--grey-100);
    border: 1px solid var(--grey-300);
    border-radius: var(--border-radius);
    padding: 0 12px;
}
.asset-selector-wrapper .fa-database {
    color: var(--grey-700);
}
#global-asset-selector {
    background: transparent;
    border: none;
    outline: none;
    padding: 8px 5px;
    font-size: 0.9em;
    font-weight: 500;
    color: var(--grey-900);
    cursor: pointer;
}

/* === NEW: Auth Page Redesign === */
.auth-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    width: 100%;
}

.auth-form-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 60px;
    background-color: #fff;
}

.auth-branding-side {
    background-color: var(--grey-100);
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form-side .login-logo {
    max-width: 200px;
    margin-bottom: 25px;
}

.auth-form-side h2 {
    margin-bottom: 10px;
}

.auth-form-side p {
    margin-bottom: 25px;
    color: var(--grey-700);
}

.auth-form-side form .form-group {
    margin-bottom: 15px;
}

.auth-form-side form label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.auth-form-side form input {
    display: block; width: 100%; padding: 12px 15px;
    font-size: 1em; line-height: 1.5; color: #495057; background-color: #fff;
    border: 1px solid #ced4da; border-radius: 4px; box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form-side form input:focus {
    border-color: var(--primary-color); outline: 0;
    box-shadow: 0 0 0 3px rgba(49, 59, 119, 0.15);
}

.value-prop-list {
    list-style: none;
    padding: 0;
    margin-top: 40px;
}

.value-prop-list li {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
}

.value-prop-list .icon {
    font-size: 1.5em;
    color: var(--primary-color);
    margin-top: 4px;
}

.value-prop-list h4 {
    margin-bottom: 5px;
    color: var(--grey-900);
}

.value-prop-list p {
    font-size: 0.95em;
    color: var(--grey-700);
}

.auth-footer-link {
    text-align: center;
    margin-top: 25px;
    font-size: 0.9em;
}

/* Responsive stacking for mobile */
@media (max-width: 992px) {
    .auth-grid-container {
        grid-template-columns: 1fr;
    }
    .auth-branding-side {
        display: none; /* Hide branding on mobile for a focused form */
    }
    .auth-form-side {
        padding: 40px 20px;
    }
}