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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.header {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header .subtitle {
    color: #666;
    font-size: 1.1em;
}

.btn-back {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-back:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

/* Main Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.data-centers-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.tools-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Data Center Cards */
.data-center-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.data-center-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.xiamen-center {
    border-top: 5px solid #4facfe;
}

.hongkong-center {
    border-top: 5px solid #667eea;
}

.center-header {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8ebff 100%);
    padding: 20px;
    text-align: center;
}

.xiamen-center .center-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.hongkong-center .center-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.center-header h2 {
    color: white;
    font-size: 1.5em;
    margin: 0;
}

.center-stats {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background: #f8f9ff;
    border-bottom: 2px solid #e0e0e0;
}

.stat-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-item i {
    font-size: 1.5em;
    color: #667eea;
}

.xiamen-center .stat-item i {
    color: #4facfe;
}

.hongkong-center .stat-item i {
    color: #667eea;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: #333;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
}

.scroll-container {
    height: 400px;
    overflow: hidden;
    position: relative;
}

.patient-list {
    padding: 15px;
}

.patient-row {
    display: grid;
    grid-template-columns: 70px 50px 40px 50px 1fr 100px;
    gap: 10px;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 10px;
    background: #f8f9ff;
    border-radius: 8px;
    border-left: 4px solid #4facfe;
    transition: all 0.3s;
}

.hongkong-center .patient-row {
    border-left-color: #667eea;
}

.patient-row:hover {
    background: #e8ebff;
    transform: translateX(5px);
}

.patient-row.cancer-case {
    background: #fff3e0;
    border-left-color: #ff9800;
}

.patient-id {
    font-weight: 600;
    color: #333;
    min-width: 70px;
}

.patient-age {
    color: #666;
    min-width: 50px;
}

.patient-gender {
    color: #666;
    min-width: 40px;
}

.hp-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

.hp-positive {
    background: #ffebee;
    color: #c62828;
}

.hp-negative {
    background: #e8f5e9;
    color: #2e7d32;
}

.pathology-type {
    color: #555;
    font-size: 0.9em;
}

.admission-date {
    color: #888;
    font-size: 0.85em;
    text-align: right;
}

.loading-text, .error-text {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1em;
}

.error-text {
    color: #d32f2f;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.tool-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.tool-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.5em;
    color: white;
}

.amr-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gc-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.tool-card h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.tool-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.feature-list {
    list-style: none;
    margin-bottom: 25px;
}

.feature-list li {
    padding: 8px 0;
    color: #555;
}

.feature-list i {
    color: #28a745;
    margin-right: 10px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(86, 171, 47, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Card */
.card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.upload-area:hover {
    background: #f0f2ff;
    border-color: #764ba2;
}

.upload-area.dragover {
    background: #e8ebff;
    border-color: #764ba2;
}

.upload-icon {
    font-size: 4em;
    color: #667eea;
    margin-bottom: 20px;
}

.file-types {
    color: #999;
    font-size: 0.9em;
    margin-top: 10px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 0.9em;
}

/* Info Box */
.info-box {
    background: #e7f3ff;
    border-left: 4px solid #2196F3;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.info-box h4 {
    color: #1976d2;
    margin-bottom: 10px;
}

.info-box ul {
    list-style: none;
    padding-left: 0;
}

.info-box li {
    padding: 5px 0;
    color: #555;
}

/* Method Selector */
.method-selector {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.method-btn {
    flex: 1;
    max-width: 300px;
    padding: 30px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.method-btn i {
    font-size: 2.5em;
    color: #667eea;
}

.method-btn span {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

.method-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.method-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.method-btn.active i,
.method-btn.active span {
    color: white;
}

.input-section {
    display: none;
}

.input-section.active {
    display: block;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
}

.stat-value {
    font-size: 2.5em;
    font-weight: 700;
    margin: 10px 0;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Table */
.results-table-container {
    overflow-x: auto;
}

.table-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.table-controls input,
.table-controls select {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.table-controls input {
    flex: 1;
    min-width: 200px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: #f8f9ff;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    font-weight: 600;
    color: #333;
}

tbody tr:hover {
    background: #f8f9ff;
}

/* Risk Level Badges */
.risk-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.risk-low {
    background: #d4edda;
    color: #155724;
}

.risk-medium {
    background: #fff3cd;
    color: #856404;
}

.risk-high {
    background: #f8d7da;
    color: #721c24;
}

.risk-very-high {
    background: #d6293e;
    color: white;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.result-card {
    background: #f8f9ff;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.result-card.full-width {
    grid-column: 1 / -1;
}

.result-card h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Result Summary */
.result-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.result-summary h3 {
    margin-bottom: 15px;
}

/* Gene List */
.gene-list {
    list-style: none;
}

.gene-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.gene-name {
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.gene-details {
    color: #666;
    margin-top: 5px;
    font-size: 0.9em;
}

/* Antibiotic Lists */
.antibiotic-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.antibiotic-tag {
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.resistant {
    background: #f8d7da;
    color: #721c24;
}

.sensitive {
    background: #d4edda;
    color: #155724;
}

/* Treatment Regimen */
.regimen-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    border: 2px solid #667eea;
}

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

.regimen-name {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.success-rate {
    background: #d4edda;
    color: #155724;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9em;
}

.drug-list {
    list-style: none;
    margin: 10px 0;
}

.drug-list li {
    padding: 5px 0;
    color: #555;
}

.drug-list li:before {
    content: "💊 ";
    margin-right: 8px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Info Section */
.info-section {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.info-section h3 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.8em;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.info-card {
    padding: 20px;
    background: #f8f9ff;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.info-card h4 {
    color: #333;
    margin-bottom: 10px;
}

.info-card p {
    color: #666;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
    color: #666;
}

.footer a {
    color: #667eea;
    text-decoration: none;
    margin: 0 10px;
}

.footer a:hover {
    text-decoration: underline;
}

/* Loading */
.loading {
    text-align: center;
    color: #999;
    padding: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .method-selector {
        flex-direction: column;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .btn-back {
        position: static;
        display: block;
        margin-bottom: 20px;
    }
    
    .scroll-container {
        height: 300px;
    }
    
    .patient-row {
        font-size: 0.85em;
        padding: 10px;
        grid-template-columns: 60px 45px 35px 45px 1fr;
        gap: 5px;
    }
    
    .admission-date {
        display: none;
    }
    
    .stat-value {
        font-size: 1.5em;
    }
}
