:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-gray: #ecf0f1;
    --medium-gray: #bdc3c7;
    --dark-gray: #7f8c8d;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

h1 {
    color: var(--primary-color);
    font-weight: 600;
}

.search-container {
    position: relative;
    min-width: 250px;
}

.search-container i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dark-gray);
}

.search-container input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.search-container input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.patient-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 20px;
}

.patient-table {
    width: 100%;
    border-collapse: collapse;
}

.patient-table th {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 15px;
    text-align: left;
}

.patient-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--light-gray);
}

.patient-table tr:last-child td {
    border-bottom: none;
}

.patient-row {
    transition: background-color 0.2s;
    cursor: pointer;
}

.patient-row:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.pre-op {
    background-color: #f39c12;
    color: white;
}

.status-badge.post-op {
    background-color: #3498db;
    color: white;
}

.status-badge.follow-up {
    background-color: #2ecc71;
    color: white;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination-button {
    padding: 8px 12px;
    border: 1px solid var(--medium-gray);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-button:hover {
    background: var(--light-gray);
}

.pagination-button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Patient Profile Page */
.patient-header {
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.back-button {
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.back-button:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.patient-profile {
    display: flex;
    gap: 30px;
    width: 100%;
}

.profile-column {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 25px;
}

.section-title {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--light-gray);
}

.section-title h2 {
    color: var(--primary-color);
    font-size: 20px;
}

.editable-field {
    padding: 8px 12px;
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    min-height: 38px;
}

.editable-field[contenteditable="true"] {
    border-color: var(--medium-gray);
    transition: border-color 0.2s;
}

.editable-field[contenteditable="true"]:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.editable-field.notes {
    min-height: 100px;
}

.chart-container {
    height: 250px;
    background: var(--light-gray);
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--dark-gray);
}

.chart-placeholder {
    text-align: center;
    padding: 20px;
}

.chart-icon {
    font-size: 40px;
    margin-bottom: 10px;
    color: var(--medium-gray);
}

.prediction-feedback h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.prediction-feedback p {
    margin-bottom: 15px;
    color: var(--dark-gray);
}

.feedback-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.feedback-button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.feedback-button.yes {
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--success-color);
}

.feedback-button.no {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

.feedback-button.other {
    background-color: rgba(155, 89, 182, 0.1);
    color: #9b59b6;
}

.feedback-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.comment-section textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

.comment-section textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}


/* Add these to your existing styles */
.prediction-section {
    margin-top: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 25px;
}

.surgical-data {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
}


.data-field:last-child {
    border-bottom: none;
}


.editable-field {
    padding: 8px 0;
    color: #333;
}

.data-columns {
    display: flex;
    gap: 20px;
    flex-grow: 1; /* Fill available height */
}


.data-subcolumn {
    flex: 1;
    min-width: 0;
}

.patient-data {
    flex: 1; /* Takes up available space */
    min-width: 0; /* Prevents overflow */
    display: flex;
    flex-direction: column;
}

.prediction-data {
    width: 50%; /* Fixed width for prediction column */
    min-width: 400px; /* Minimum width to prevent squeezing */
}

/* Better spacing for data fields */
.data-field {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(245, 245, 245, 0.3);
    border-radius: 4px;
}

.data-field label {
    display: block;
    font-size: 13px;
    color: var(--dark-gray);
    margin-bottom: 5px;
}


.data-field .editable-field {
    font-size: 15px;
    font-weight: 500;
    color: var(--primary-color);
    padding: 5px 0;
}



/* Responsive behavior */
@media (max-width: 1024px) {
    .patient-profile {
        flex-direction: column;
    }
    
    .prediction-data {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 600px) {
    .data-columns {
        flex-direction: column;
        gap: 15px;
    }
    
    .chart-container {
        height: 250px;
    }
}

/* Add to your styles.css */
.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 20px;
    transition: background-color 0.2s;
}

.sortable:hover {
    background-color: rgba(44, 62, 80, 0.1);
}

.sortable i {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
}

.sorted-asc {
    background-color: rgba(52, 152, 219, 0.1);
}

.sorted-desc {
    background-color: rgba(52, 152, 219, 0.1);
}

/* Prediction Form Styles */
.prediction-form-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 25px;
    margin-bottom: 30px;
}

.form-columns {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-column {
    flex: 1;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--primary-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    font-size: 15px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-actions {
    text-align: right;
}

.submit-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.submit-button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}



/* Prediction Results Styles */
.prediction-result {
    padding: 20px;
}

.risk-level {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 8px;
}

.risk-level h3 {
    margin-bottom: 10px;
    font-size: 24px;
}

.risk-high {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

.risk-moderate {
    background-color: rgba(241, 196, 15, 0.1);
    color: var(--warning-color);
}

.risk-low {
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--success-color);
}

.model-info {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--light-gray);
}

.important-factors ul {
    list-style-type: none;
}

.important-factors li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--medium-gray);
}

.predict-button {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 15px;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.predict-button:hover {
    background-color: #2980b9;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-back {
    background: var(--light-gray);
    color: var(--primary-color);
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-back:hover {
    background: var(--medium-gray);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    font-size: 16px;
}

/* Feedback Section */
.clinician-feedback {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.feedback-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.feedback-buttons button {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.feedback-buttons button.active {
    border-color: var(--primary-color);
    background-color: rgba(44, 62, 80, 0.1);
}

.feedback-buttons button:hover {
    transform: translateY(-2px);
}

.feedback-notes textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
}

.btn-save-notes {
    margin-top: 10px;
    padding: 8px 15px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}


/* Number styling */
.probability-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 14px;
    color: #000;
    text-shadow: 
        -1px -1px 0 #fff,  
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff;  /* White outline effect */
    mix-blend-mode: normal;
    pointer-events: none;
    z-index: 2;
}

.risk-high .probability-value,
.risk-moderate .probability-value {
    color: #fff;
    text-shadow: 
        -1px -1px 0 #000,  
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;  /* Black outline for light text */
}

/* === GAUGE - FINAL WORKING VERSION === */
.probability-gauge {
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    margin: 15px 0;
    position: relative;
    overflow: hidden;
}

.gauge-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    border-radius: 15px;
    transition: width 0.5s ease;
    z-index: 1;
}

.risk-low .gauge-fill { background: linear-gradient(to right, #4CAF50, #2E7D32); }
.risk-moderate .gauge-fill { background: linear-gradient(to right, #FFC107, #FF9800); }
.risk-high .gauge-fill { background: linear-gradient(to right, #F44336, #C62828); }

.probability-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 14px;
    z-index: 2;
    color: white;
    text-shadow: 
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
}

.risk-low .probability-value {
    color: #000;
    text-shadow: 
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff;
}

.probability-gauge { outline: 1px solid green; }
.gauge-fill { outline: 1px solid blue; }

/* Add to styles.css */
.risk-very-high {
    background-color: rgba(142, 36, 170, 0.1);
    color: #8e24aa;
}

/* Update the gauge colors for grades */
.risk-low .gauge-fill { background: linear-gradient(to right, #4CAF50, #2E7D32); }
.risk-moderate-risk .gauge-fill { background: linear-gradient(to right, #FFC107, #FF9800); }
.risk-high-risk .gauge-fill { background: linear-gradient(to right, #F44336, #C62828); }
.risk-very-high-risk .gauge-fill { background: linear-gradient(to right, #8e24aa, #6a1b9a); }

/* Style for probability breakdown */
.probability-breakdown {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--medium-gray);
}

.probability-breakdown h4 {
    margin-bottom: 10px;
    font-size: 16px;
}

.probability-breakdown ul {
    list-style-type: none;
}

.probability-breakdown li {
    padding: 5px 0;
    display: flex;
    justify-content: space-between;
}

/* Add these to your existing styles */
.data-section {
    margin-bottom: 25px;
    background: rgba(245, 245, 245, 0.5);
    border-radius: 8px;
    padding: 15px;
}

.data-section-title {
    color: var(--primary-color);
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--light-gray);
}

/* Enhance existing data-field style */
.data-field {
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.probability-grade {
    font-weight: 600;
    text-align: center;
    padding: 8px;
}

.btn-export {
    background-color: var(--secondary-color);
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
    transition: all 0.2s;
}

.btn-export:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn-export i {
    margin-right: 5px;
}

/* Title Page Styles */
.title-page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 2rem;
}

.logo-row {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.title-logo {
    max-height: 240px;
    max-width: 100%;
    object-fit: contain;
}

.title-logo-smol {
    max-height: 120px;
    max-width: 100%;
    object-fit: contain;
}

.title-button-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 400px;
}

.title-button {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.title-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background-color: var(--secondary-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .logo-row {
        gap: 2rem;
        margin-bottom: 3rem;
    }
    .title-button {
        font-size: 1.2rem;
        padding: 1.2rem;
    }
}

/* Navbar Styles */
.main-navbar {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-logos {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-logo {
    height: 40px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

.navbar-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    background-color: rgba(44, 62, 80, 0.1);
    color: var(--secondary-color);
}

.nav-link i {
    font-size: 1.1em;
}

/* Adjust container to account for navbar */
.container {
    padding-top: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-navbar {
        flex-direction: column;
        padding: 1rem;
    }
    
    .navbar-logos {
        margin-bottom: 1rem;
    }
    
    .navbar-links {
        width: 100%;
        justify-content: space-around;
    }
    
    .nav-link {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}
