/* RAIsonance Field Screener Styles */
/* Color Palette */
:root {
    --background: #ffffff;
    --primary-blue: #006BA6;
    --text-dark: #333333;
    --text-medium: #4D4D4D;
    --text-light: #666666;
    --card-bg: #f8f9fa;
    --deep-magenta: #D82B74;
    --bright-blue: #29ABE2;
    --mid-blue: #006BA6;
    --golden: #F58546;
    --border-color: #ddd;
    --error-color: #dc3545;
    --success-color: #28a745;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    color: var(--text-medium);
    background-color: var(--background);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1 {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

h2 {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

h3 {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    background: #ffffff;
}

.login-card {
    background: white;
    padding: 3rem 2rem;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    margin: auto;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.logo {
    width: 80px;
    height: 80px;
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 0.5px;
}

.login-card h1 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-medium);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.9375rem;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.forgot-password {
    display: block;
    text-align: right;
    color: var(--primary-blue);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

.btn-sign-in {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    margin-top: 0.5rem;
    border-radius: 25px;
}

.login-footer {
    width: 100%;
    padding: 1rem;
    text-align: center;
    color: var(--text-medium);
    font-size: 0.75rem;
    background: #ffffff;
}

.login-footer p {
    margin: 0.125rem 0;
    font-size: 0.75rem;
}

/* Main Page */
.main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-header {
    background: linear-gradient(135deg, var(--bright-blue) 0%, var(--primary-blue) 100%);
    color: white;
    padding: 0.75rem 3.5rem 0.75rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: calc(100% - 3rem);
}

.header-logo {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 6px;
    padding: 0.125rem;
    flex-shrink: 0;
}

.main-header h1 {
    color: white;
    margin: 0;
    font-size: 1.125rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-btn {
    background: transparent;
    border: none;
    color: #d3d3d3;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 0.5rem;
    flex-shrink: 0;
}

.settings-btn:hover {
    color: #ffffff;
    transform: rotate(90deg);
}

.main-content {
    flex: 1;
    padding: 2rem 1rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.screener-types-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.loading-message {
    text-align: center;
    padding: 3rem 1rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--card-bg);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: #f8d7da;
    color: var(--error-color);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid var(--error-color);
}

.success-message {
    background: #d4edda;
    color: var(--success-color);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid var(--success-color);
}

.screener-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.screener-table th,
.screener-table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.screener-table th {
    background: var(--card-bg);
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.875rem;
}

.screener-table td {
    font-size: 0.9375rem;
}

.screener-table tbody tr {
    cursor: pointer;
}

.screener-table tbody tr:hover {
    background: var(--card-bg);
}

.screener-table tbody tr:active {
    background: #e9ecef;
}

.screener-table input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--primary-blue);
}

.action-container {
    text-align: center;
}

/* Screening Page */
.screening-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
}

.screening-header {
    background: linear-gradient(135deg, var(--bright-blue) 0%, var(--primary-blue) 100%);
    color: white;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.screening-header h1 {
    color: white;
    margin: 0;
    font-size: 1.125rem;
    text-align: center;
}

.screening-header .header-logo {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 6px;
    padding: 0.125rem;
}

.screening-step {
    display: none;
    flex: 1;
    padding: 2rem 1rem;
}

.screening-step.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.step-card {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px;
}

.loading-card {
    text-align: center;
    padding: 4rem 2.5rem;
}

.loading-spinner {
    margin-bottom: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.field-hint {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* iFrame Container */
.iframe-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 1000;
}

.iframe-header {
    display: none;
}

#closeScreening {
    position: fixed;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#closeScreening:hover {
    background: rgba(0, 0, 0, 0.9);
}

#screenerFrame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Settings Page */
.settings-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.settings-header {
    background: linear-gradient(135deg, var(--bright-blue) 0%, var(--primary-blue) 100%);
    color: white;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.settings-header h1 {
    color: white;
    margin: 0;
    font-size: 1.125rem;
    text-align: center;
}

.settings-header .header-logo {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 6px;
    padding: 0.125rem;
}

.settings-content {
    flex: 1;
    padding: 2rem 1rem;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.settings-card {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.api-key-input {
    display: flex;
    gap: 0.5rem;
}

.api-key-input input {
    flex: 1;
}

.btn-icon {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--border-color);
}

.default-key-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.api-info {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.endpoint-info {
    margin: 1rem 0;
}

.endpoint-url {
    font-family: monospace;
    font-size: 0.875rem;
    color: var(--primary-blue);
    word-break: break-all;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 400;
    color: var(--text-dark);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 400;
    color: var(--text-dark);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: var(--primary-blue);
}

.checkbox-label span {
    user-select: none;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--mid-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 107, 166, 0.3);
}

.btn-primary:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-disabled {
    background: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-disabled:hover {
    background: #cccccc;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 500;
}

/* Footer */
.footer {
    background: #ffffff;
    color: var(--text-medium);
    padding: 0.5rem 1rem;
    text-align: center;
    margin-top: auto;
}

.footer p {
    margin: 0.125rem 0;
    font-size: 0.75rem;
}

/* Results Page */
.results-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.results-info {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.results-info strong {
    color: var(--text-dark);
    font-weight: 500;
}

.results-disclaimer {
    background: #fff8e1;
    border: 1px solid #ffc107;
    color: var(--text-dark);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.result-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.result-type {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-dark);
    flex: 1;
    margin-right: 1rem;
}

.result-box {
    padding: 1rem 2.5rem;
    border-radius: 8px;
    font-size: 1.125rem;
    font-weight: 500;
    color: white;
    text-align: center;
    min-width: 180px;
    white-space: nowrap;
}

.result-box-low-risk {
    background: var(--success-color);
}

.result-box-high-risk {
    background: var(--error-color);
}

.result-box-unknown {
    background: var(--text-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .step-card,
    .settings-card {
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .result-card {
        padding: 1rem;
    }

    .result-type {
        font-size: 1.125rem;
    }

    .result-box {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        min-width: 140px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .main-content {
        padding: 1rem 0.5rem;
    }

    .screener-types-section,
    .results-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .result-card {
        padding: 0.875rem 1rem;
    }

    .result-type {
        font-size: 1rem;
        margin-right: 0.5rem;
    }

    .result-box {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
        min-width: 120px;
    }
}

/* ================== HAMBURGER MENU ================== */

/* Hamburger Button */
.hamburger-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    position: absolute;
    right: 0.5rem;
    flex-shrink: 0;
    z-index: 100;
}

.hamburger-btn:hover {
    color: #d3d3d3;
}

.hamburger-btn svg {
    width: 24px;
    height: 24px;
}

/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
}

/* Hamburger Menu Panel */
.hamburger-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100%;
    background-color: var(--background);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.hamburger-menu.active {
    right: 0;
}

/* Menu Header */
.menu-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.menu-user-info {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.menu-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--bright-blue));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.menu-user-details {
    flex: 1;
    min-width: 0;
}

.menu-user-name {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 1rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-user-email {
    color: var(--text-light);
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-close-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.menu-close-btn:hover {
    color: var(--text-dark);
}

/* Menu Navigation */
.menu-nav {
    padding: 0.5rem 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: background-color 0.2s ease;
    font-size: 1rem;
}

.menu-item:hover {
    background-color: var(--card-bg);
}

.menu-item svg {
    flex-shrink: 0;
    color: var(--text-light);
}

.menu-item:hover svg {
    color: var(--primary-blue);
}

.menu-item span {
    flex: 1;
}

.menu-item-logout {
    color: var(--deep-magenta);
}

.menu-item-logout svg {
    color: var(--deep-magenta);
}

.menu-item-logout:hover {
    background-color: #FFE5EE;
}

.menu-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.5rem 0;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .hamburger-menu {
        width: 280px;
        right: -280px;
    }

    .menu-header {
        padding: 1rem;
    }

    .menu-user-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .menu-item {
        padding: 0.875rem 1rem;
    }
}

/* ================== PROFILE PAGE ================== */

.profile-section {
    padding: 2rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.profile-card {
    background-color: var(--background);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.profile-header {
    background: linear-gradient(135deg, var(--primary-blue), var(--bright-blue));
    color: white;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 500;
    flex-shrink: 0;
}

.profile-name-section h2 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

.profile-email {
    opacity: 0.9;
    font-size: 1rem;
}

.profile-details {
    padding: 2rem;
}

.profile-detail-group {
    margin-bottom: 2rem;
}

.profile-detail-group:last-child {
    margin-bottom: 0;
}

.profile-detail-group h3 {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--card-bg);
}

.profile-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--card-bg);
}

.profile-detail-row:last-child {
    border-bottom: none;
}

.profile-label {
    font-weight: 500;
    color: var(--text-medium);
    flex-shrink: 0;
    margin-right: 1rem;
}

.profile-value {
    color: var(--text-dark);
    text-align: right;
    word-break: break-word;
}

/* API Key Container */
.api-key-container {
    margin-top: 1rem;
}

.api-key-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.api-key-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    background-color: var(--card-bg);
    color: var(--text-dark);
}

.btn-icon {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-medium);
}

.btn-icon:hover {
    background-color: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.api-key-note {
    font-size: 0.875rem;
    color: var(--text-light);
    font-style: italic;
}

/* Profile Actions */
.profile-actions {
    padding: 1.5rem 2rem;
    background-color: var(--card-bg);
    display: flex;
    justify-content: center;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .profile-section {
        padding: 1rem 0.5rem;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem 1rem;
    }

    .profile-avatar {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
    }

    .profile-name-section h2 {
        font-size: 1.5rem;
    }

    .profile-details {
        padding: 1.5rem 1rem;
    }

    .profile-detail-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .profile-value {
        text-align: left;
    }

    .api-key-row {
        flex-wrap: wrap;
    }

    .api-key-input {
        flex-basis: 100%;
    }

    .profile-actions {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .profile-name-section h2 {
        font-size: 1.25rem;
    }

    .profile-email {
        font-size: 0.875rem;
    }

    .profile-detail-group h3 {
        font-size: 1rem;
    }
}
