/* Modern Design System for Antigravity Lab */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #2563eb;
    --primary-light: #60a5fa;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --accent: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --success: #10b981;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
}

.app-container {
    width: 100%;
    max-width: 900px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}

/* Header & Hero Section */
header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--bg-card);
    clip-path: polygon(0 100%, 100% 100%, 100% 0);
}

.logo-container {
    margin-bottom: 1rem;
}

.logo-container img {
    height: 60px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Search Section */
.search-card {
    padding: 2rem;
    margin-top: -20px;
    position: relative;
    z-index: 10;
}

.search-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
}

@media (max-width: 640px) {
    .search-grid {
        grid-template-columns: 1fr;
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.btn-search {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-search:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-search:active {
    transform: translateY(0);
}

/* Navigation Tabs */
.app-nav {
    display: flex;
    background: #f1f5f9;
    padding: 0.5rem;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.nav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.nav-btn:hover:not(.active) {
    background: rgba(255,255,255,0.5);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Booking Section */
.booking-card {
    padding: 2.5rem;
    animation: fadeIn 0.5s ease-out;
}

.booking-header {
    text-align: center;
    margin-bottom: 2rem;
}

.booking-header h2 {
    color: var(--primary-dark);
    font-size: 1.75rem;
}

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

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.success-msg {
    text-align: center;
    padding: 2rem;
    background: #f0fdf4;
    border-radius: var(--radius-md);
    border: 1px solid #bbf7d0;
    color: #166534;
}

.success-icon {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 1rem;
}

.success-msg h3 {
    margin-bottom: 0.5rem;
}

#result-display {
    padding: 0 2rem 3rem;
    display: none;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.patient-header {
    background: var(--bg-main);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    border-left: 6px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.patient-info-text h2 {
    font-size: 1.5rem;
    color: var(--primary-dark);
}

.patient-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Results Table */
/* Vitals Dashboard */
.vitals-dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .vitals-dashboard {
        grid-template-columns: 1fr;
    }
}

.vital-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: var(--transition);
}

.vital-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.vital-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-sugar { background: #fff7ed; color: #f97316; }
.icon-heart { background: #fef2f2; color: #ef4444; }
.icon-pressure { background: #f0f9ff; color: #0ea5e9; }

.vital-name {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
}

.vital-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.25rem 0;
}

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background: #f1f5f9;
    padding: 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

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

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-normal { background: #dcfce7; color: #166534; }
.status-alert { background: #fee2e2; color: #991b1b; }
.status-warning { background: #fef3c7; color: #92400e; }

/* Print Actions */
.actions {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
}

.btn-print {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-print:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

/* Error Message */
.error-msg {
    display: none;
    background: #fef2f2;
    color: var(--danger);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 2rem;
    text-align: center;
    font-weight: 500;
    border: 1px solid #fee2e2;
}

/* Print Styles */
@media print {
    body { padding: 0; background: white; }
    .app-container { box-shadow: none; border: none; }
    header, .search-card, .actions { display: none !important; }
    #result-display { display: block !important; padding: 0; }
    .patient-header { border-left: none; background: #eee; }
    th { background: #eee !important; color: black; }
}
