* {
    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;
    color: #333;
}

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

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
}

.header h1 {
    color: #2c3e50;
    font-size: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header h1 i {
    color: #e74c3c;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

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

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-record {
    background: #e74c3c;
    color: white;
}

.btn-record:hover {
    background: #c0392b;
}

.btn-record.recording {
    background: #27ae60;
    animation: pulse 1s infinite;
}

.btn-stop {
    background: #e67e22;
    color: white;
}

.btn-stop:hover {
    background: #d35400;
}

/* Search Section */
.search-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

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

/* Search Form */
.search-form {
    margin-bottom: 40px;
}

.input-group {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 50px;
    padding: 8px 8px 8px 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.input-group:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.2);
}

.input-group:focus-within {
    border-color: #2980b9;
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.input-group i {
    color: #bdc3c7;
    margin-right: 15px;
    font-size: 16px;
}

.input-group input {
    flex: 1;
    border: none;
    padding: 18px 0;
    font-size: 16px;
    outline: none;
    background: transparent;
    color: #2c3e50;
}

.input-group input::placeholder {
    color: #95a5a6;
}

.input-group .btn {
    margin: 0;
    border-radius: 50px;
    padding: 12px 25px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* Dashboard Quick Info */
.dashboard-quick-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 1px solid #dee2e6;
    padding: 20px 30px;
}

.quick-info-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.patient-quick-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.patient-avatar-small i {
    font-size: 32px;
    color: #3498db;
}

.patient-details-small h4 {
    color: #2c3e50;
    margin: 0 0 5px 0;
    font-size: 18px;
}

.patient-details-small span {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
}

.vital-signs-quick {
    display: flex;
    gap: 20px;
}

.vital-quick-item {
    text-align: center;
}

.vital-label-small {
    display: block;
    font-size: 11px;
    color: #95a5a6;
    margin-bottom: 3px;
}

.vital-value-small {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #2c3e50;
}

.vital-value-small.anomaly {
    color: #e74c3c;
}

.quick-alerts {
    display: flex;
    align-items: center;
}

.alert-small {
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.alert-warning-small {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Recent Patients Table */
.recent-patients-section {
    margin-bottom: 30px;
}

.section-title {
    text-align: center;
    margin-bottom: 25px;
}

.section-title h3 {
    color: #2c3e50;
    font-size: 22px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.section-title p {
    color: #7f8c8d;
    font-size: 14px;
}

.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.patients-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.patients-table thead {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.patients-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.patients-table tbody tr {
    border-bottom: 1px solid #f1f2f6;
    transition: all 0.3s ease;
    cursor: pointer;
}

.patients-table tbody tr:hover {
    background: #f8f9fa;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.patients-table td {
    padding: 15px 12px;
    vertical-align: middle;
}

.patient-id-cell {
    font-weight: bold;
    color: #3498db;
}

.patient-name-cell {
    font-weight: 600;
    color: #2c3e50;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-high {
    background: #fee;
    color: #e74c3c;
    border: 1px solid #f5c6cb;
}

.status-medium {
    background: #fef9e7;
    color: #f39c12;
    border: 1px solid #ffeaa7;
}

.status-low {
    background: #eef;
    color: #27ae60;
    border: 1px solid #c3e6cb;
}

.vital-cell {
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.btn-view {
    padding: 6px 15px;
    font-size: 12px;
    border-radius: 15px;
    background: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-view:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 40px;
    background: white;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-item i {
    font-size: 24px;
    color: #3498db;
    padding: 12px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 50%;
}

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 14px;
    color: #7f8c8d;
    margin-top: 5px;
}

.search-results {
    margin-top: 20px;
    text-align: left;
}

.patient-result {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.patient-result:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Dashboard Section */
.dashboard-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.patient-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 2px solid #ecf0f1;
    margin-bottom: 30px;
}

.patient-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.patient-avatar i {
    font-size: 60px;
    color: #3498db;
}

.patient-details h2 {
    color: #2c3e50;
    margin-bottom: 5px;
}

.patient-details p {
    color: #7f8c8d;
    margin-bottom: 10px;
}

.patient-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #95a5a6;
}

/* Doctor Info Styles */
.doctor-info {
    margin-top: 15px;
    padding: 10px 0;
    border-top: 1px solid #ecf0f1;
}

.doctor-details {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #27ae60;
}

.doctor-details i {
    font-size: 18px;
    color: #27ae60;
}

.doctor-details > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.doctor-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.doctor-name:hover {
    color: #3498db;
}

.doctor-department {
    font-size: 12px;
    color: #7f8c8d;
}

.doctor-contact {
    font-size: 12px;
    color: #95a5a6;
}

.alert {
    padding: 10px 15px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Dashboard Content */
.dashboard-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

/* Vital Signs */
.vital-signs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.vital-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.vital-label {
    font-weight: 500;
    color: #7f8c8d;
}

.vital-value {
    font-weight: bold;
    color: #2c3e50;
}

.vital-value.anomaly {
    color: #e74c3c;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

/* Voice Notes */
.voice-recorder {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.recording-status {
    color: #e74c3c;
    font-weight: 500;
}

.voice-notes-list {
    max-height: 200px;
    overflow-y: auto;
}

.voice-note {
    background: #f8f9fa;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voice-note-info {
    flex: 1;
}

.voice-note-date {
    font-size: 12px;
    color: #7f8c8d;
}

.voice-note-duration {
    font-size: 12px;
    color: #95a5a6;
}

.voice-note-controls {
    display: flex;
    gap: 5px;
}

.btn-play, .btn-delete {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-play {
    background: #27ae60;
    color: white;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

/* Charts */
canvas {
    max-height: 300px;
}

/* Anomaly Detection */
.anomaly-list {
    max-height: 250px;
    overflow-y: auto;
}

.anomaly-item {
    background: #fff5f5;
    border-left: 4px solid #e74c3c;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 10px;
}

.anomaly-title {
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 5px;
}

.anomaly-description {
    color: #7f8c8d;
    font-size: 14px;
}

.anomaly-severity {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
    margin-top: 5px;
}

.severity-high {
    background: #e74c3c;
    color: white;
}

.severity-medium {
    background: #f39c12;
    color: white;
}

.severity-low {
    background: #f1c40f;
    color: #333;
}

/* Forecasts */
.forecasts-list {
    margin-bottom: 20px;
}

.forecast-item {
    background: #f0f8ff;
    border-left: 4px solid #3498db;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 10px;
}

.forecast-title {
    font-weight: bold;
    color: #3498db;
    margin-bottom: 5px;
}

.forecast-description {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 5px;
}

.forecast-confidence {
    font-size: 12px;
    color: #95a5a6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }
    
    .vital-signs {
        grid-template-columns: 1fr;
    }
    
    .patient-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .patient-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .input-group {
        flex-direction: column;
        padding: 15px;
    }
    
    .input-group input {
        margin-bottom: 10px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Header Actions and Doctor Selector */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.doctor-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.doctor-dropdown {
    padding: 8px 15px;
    border: 2px solid #3498db;
    border-radius: 5px;
    background: white;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.doctor-dropdown:hover {
    border-color: #2980b9;
}

.doctor-dropdown:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Today Patients Section */
.today-patients-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.section-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.section-header h2 {
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 10px;
}

.section-header p {
    color: #7f8c8d;
    font-size: 16px;
}

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

.stat-card {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card i {
    font-size: 24px;
    opacity: 0.8;
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: bold;
}

.stat-label {
    display: block;
    font-size: 12px;
    opacity: 0.9;
}

/* Today Patients Grid */
.patients-list h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.today-patients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.patient-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
    cursor: pointer;
}

.patient-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.patient-card.has-anomaly {
    border-left-color: #e74c3c;
}

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

.patient-card-name {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.patient-card-id {
    font-size: 12px;
    color: #95a5a6;
    background: #ecf0f1;
    padding: 2px 8px;
    border-radius: 10px;
}

.patient-card-vitals {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.vital-quick {
    font-size: 12px;
    color: #7f8c8d;
}

.vital-quick strong {
    color: #2c3e50;
}

.patient-card-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
}

.status-normal {
    background: #d5edda;
    color: #155724;
}

.status-anomaly {
    background: #f8d7da;
    color: #721c24;
}

.last-visit {
    font-size: 11px;
    color: #95a5a6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .patients-stats {
        grid-template-columns: 1fr;
    }
    
    .today-patients-grid {
        grid-template-columns: 1fr;
    }
    
    .doctor-selector {
        flex-direction: column;
        gap: 5px;
    }
    
    /* Search Section Mobile */
    .search-section {
        padding: 20px;
    }
    
    .search-header h2 {
        font-size: 24px;
        flex-direction: column;
        gap: 5px;
    }
    
    .input-group {
        flex-direction: column;
        border-radius: 15px;
        padding: 15px;
        gap: 15px;
    }
    
    .input-group input {
        padding: 15px 0;
        text-align: center;
    }
    
    .input-group .btn {
        width: 100%;
        border-radius: 10px;
    }
    
    /* Table Mobile */
    .table-container {
        font-size: 12px;
    }
    
    .patients-table th,
    .patients-table td {
        padding: 8px 6px;
    }
    
    .patients-table th:nth-child(n+6),
    .patients-table td:nth-child(n+6) {
        display: none;
    }
    
    /* Quick Stats Mobile */
    .quick-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-item {
        padding: 15px;
    }
    
    .stat-number {
        font-size: 24px;
    }
    
    /* Dashboard Quick Info Mobile */
    .quick-info-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .vital-signs-quick {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
}
