/* Medical & Health Management Styles */

:root {
    --medical-primary: #1e88e5;
    --medical-hover: #1565c0;
    --medical-success: #28a745;
    --medical-warning: #ffc107;
    --medical-danger: #dc3545;
    --medical-info: #17a2b8;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
}

/* Main container */
.medical-main {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
    background-color: var(--light-color);
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header-left {
    display: flex;
    flex-direction: column;
}

.page-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.page-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Tab Navigation - Two Row Grid Layout */
.tab-navigation {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-btn:hover {
    color: var(--medical-primary);
    background: var(--bg-tertiary);
}

.tab-btn.active {
    color: var(--medical-primary);
    background: var(--bg-secondary);
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

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

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.8rem;
    color: var(--medical-primary);
}

.section-header h3 {
    font-size: 1.4rem;
    color: var(--medical-primary);
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--medical-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

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

.btn-danger {
    background: var(--medical-danger);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: var(--medical-success);
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Cards */
.card {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    margin-bottom: 1rem;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--medical-primary);
}

.card-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Status Badges */
.badge-active { background: #d4edda; color: #155724; }
.badge-managed { background: #d1ecf1; color: #0c5460; }
.badge-resolved { background: #cce5ff; color: #004085; }
.badge-current { background: #d4edda; color: #155724; }
.badge-expired { background: #f8d7da; color: #721c24; }
.badge-needs_renewal { background: #fff3cd; color: #856404; }
.badge-ready { background: #d4edda; color: #155724; }
.badge-needs_restocking { background: #fff3cd; color: #856404; }
.badge-expired_items { background: #f8d7da; color: #721c24; }
.badge-incomplete { background: #f8d7da; color: #721c24; }
.badge-completed { background: #cce5ff; color: #004085; }
.badge-recovered { background: #d4edda; color: #155724; }

/* Severity Badges */
.badge-mild { background: #d1ecf1; color: #0c5460; }
.badge-moderate { background: #fff3cd; color: #856404; }
.badge-severe { background: #f8d7da; color: #721c24; }
.badge-critical { background: #d63384; color: white; }

/* Grids */
.supplies-grid,
.conditions-grid,
.records-grid,
.vaccinations-grid,
.prescriptions-grid,
.vitals-grid,
.providers-grid,
.skills-grid,
.kits-grid,
.quarantine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Info Items */
.info-item {
    margin-bottom: 0.8rem;
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
    font-weight: 500;
}

.info-value {
    font-weight: 500;
    color: var(--text-primary);
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Notifications */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Vital Signs Grid */
.vitals-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.vital-box {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
}

.vital-box-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.vital-box-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--medical-primary);
}

.vital-box-unit {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-left: 0.2rem;
}

/* Expiration Warnings */
.expiring-soon {
    border-left: 4px solid var(--medical-warning);
}

.expired {
    border-left: 4px solid var(--medical-danger);
}

/* Edit Page Layout */
.medical-edit-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.medical-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.medical-edit-header h1 {
    font-size: 1.75rem;
    color: var(--medical-primary);
    margin: 0;
}

.medical-edit-actions {
    display: flex;
    gap: 0.75rem;
}

.medical-edit-actions .btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
}

.medical-edit-card {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.medical-edit-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--medical-primary);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group-full {
    grid-column: 1 / -1;
}

/* Responsive */
@media (max-width: 1200px) {
    .tab-navigation {
        grid-template-columns: repeat(4, 1fr);
    }

    .tab-btn {
        font-size: 0.9rem;
        padding: 0.7rem 0.8rem;
    }
}

@media (max-width: 992px) {
    .tab-navigation {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }

    .tab-navigation {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }

    .tab-btn {
        font-size: 0.85rem;
        padding: 0.6rem 0.5rem;
    }

    .supplies-grid,
    .conditions-grid,
    .records-grid,
    .vaccinations-grid,
    .prescriptions-grid,
    .vitals-grid,
    .providers-grid,
    .skills-grid,
    .kits-grid,
    .quarantine-grid {
        grid-template-columns: 1fr;
    }

    .vitals-summary {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    /* Edit form responsive */
    .form-row {
        grid-template-columns: 1fr;
    }

    .medical-edit-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .medical-edit-actions {
        width: 100%;
    }

    .medical-edit-actions button {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .tab-navigation {
        grid-template-columns: 1fr;
    }

    .tab-btn {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
}
