/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #1e293b;
    background-color: #f8fafc;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Login Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.login-header p {
    color: #64748b;
    font-size: 0.875rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.login-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    text-align: center;
    font-weight: 500;
}

.login-form input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Header Styles */
.header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-left .logo {
    background: #3b82f6;
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.header-left h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.header-left p {
    font-size: 0.875rem;
    color: #64748b;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Main Content */
.main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-success {
    background: #059669;
    color: white;
}

.btn-success:hover {
    background: #047857;
}

.btn-ghost {
    color: #64748b;
    background: transparent;
}

.btn-ghost:hover {
    color: #1e293b;
    background: #f1f5f9;
}

.btn-delete {
    color: #dc2626;
    background: transparent;
    padding: 0.25rem;
    border: none;
    cursor: pointer;
    border-radius: 0.25rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
}

.btn-delete:hover {
    background: #fef2f2;
    color: #991b1b;
}

/* Messages */
.success {
    background: #d1fae5;
    color: #065f46;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #a7f3d0;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #fecaca;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    transition: all 0.2s;
}

.tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.tab-btn:hover {
    color: #1e293b;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Cards */
.card {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card > p {
    color: #64748b;
    margin-bottom: 2rem;
}

/* Forms */
.vital-form .form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .vital-form .form-row:nth-child(3) {
        grid-template-columns: 1fr 1fr;
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: #374151;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    text-align: center;
    font-weight: 500;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: #64748b;
    font-size: 0.75rem;
}

.bp-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bp-inputs input {
    flex: 1;
}

.bp-inputs span {
    font-weight: 700;
    font-size: 1.25rem;
    color: #64748b;
}

/* History Table */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.mobile-export {
    display: none;
}

@media (max-width: 640px) {
    .mobile-export {
        display: flex;
        padding: 0.75rem;
    }
    
    .header-right .btn-success {
        display: none;
    }
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
}

.table-container {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.history-table th {
    background: #f8fafc;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}

.history-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}

.history-table tr:hover {
    background: #f8fafc;
}

.date-time .date {
    font-weight: 500;
    color: #1e293b;
}

.date-time .time {
    color: #64748b;
    font-size: 0.75rem;
}

.value {
    font-weight: 500;
    color: #1e293b;
}

.unit {
    display: block;
    color: #64748b;
    font-size: 0.75rem;
}

.na {
    color: #64748b;
    font-style: italic;
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid #e2e8f0;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-left .logo {
    background: #3b82f6;
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.footer-left p {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.footer-left small {
    color: #64748b;
    font-size: 0.75rem;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: #64748b;
    font-size: 0.875rem;
}

.footer-right a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-right a:hover {
    color: #1e293b;
}

/* Mobile Responsive - Proper Mobile View */
@media (max-width: 768px) {
    /* Increase base font size for mobile */
    body {
        font-size: 18px;
        line-height: 1.7;
    }
    
    /* Container adjustments */
    .main {
        padding: 1rem 0.5rem;
    }
    
    /* Header mobile adjustments */
    .header-content {
        padding: 0.75rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-left {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .header-left .logo {
        width: 3rem;
        height: 3rem;
        font-size: 1.5rem;
    }
    
    .header-left h1 {
        font-size: 1.5rem;
    }
    
    .header-left p {
        font-size: 1rem;
        display: block;
    }
    
    .header-right {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }
    
    .header-right .btn {
        width: 100%;
        justify-content: center;
        padding: 1rem;
        font-size: 1rem;
    }
    
    /* Login form mobile */
    .login-container {
        padding: 1rem;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
    }
    
    .login-header h1 {
        font-size: 1.75rem;
    }
    
    .login-header p {
        font-size: 1rem;
    }
    
    .login-form input {
        font-size: 1.125rem;
        padding: 1rem;
        height: auto;
    }
    
    .login-form .btn {
        font-size: 1.125rem;
        padding: 1rem;
    }
    
    /* Cards mobile */
    .card {
        padding: 1.5rem 1rem;
        margin: 0 0.5rem;
    }
    
    .card h2 {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }
    
    .card > p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    /* Tabs mobile */
    .tabs {
        margin: 0 0.5rem 2rem 0.5rem;
        overflow-x: auto;
    }
    
    .tab-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        white-space: nowrap;
        min-width: 150px;
    }
    
    /* Form mobile improvements */
    .vital-form .form-group {
        margin-bottom: 2rem;
    }
    
    .vital-form label {
        font-size: 1.125rem;
        margin-bottom: 1rem;
        font-weight: 600;
    }
    
    .vital-form input {
        font-size: 1.25rem;
        padding: 1.25rem;
        height: auto;
        border-width: 2px;
    }
    
    .vital-form .btn-primary {
        font-size: 1.25rem;
        padding: 1.25rem 2rem;
        width: 100%;
        height: auto;
    }
    
    .bp-inputs {
        gap: 1rem;
    }
    
    .bp-inputs span {
        font-size: 1.5rem;
        min-width: 20px;
        text-align: center;
    }
    
    .form-group small {
        font-size: 0.875rem;
        margin-top: 0.75rem;
    }
    
    /* History header mobile */
    .history-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        text-align: center;
    }
    
    .mobile-export {
        display: none;
    }
    
    /* Table mobile - Stack layout */
    .table-container {
        overflow: visible;
    }
    
    .history-table {
        display: none; /* Hide regular table on mobile */
    }
    
    /* Mobile card layout for table data */
    .mobile-history {
        display: block;
    }
    
    .history-entry {
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 0.75rem;
        padding: 1.5rem;
        margin-bottom: 1rem;
        position: relative;
    }
    
    .history-entry-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .history-date-time {
        font-weight: 600;
        font-size: 1.125rem;
        color: #1e293b;
    }
    
    .history-date-time .time {
        font-size: 1rem;
        color: #64748b;
        font-weight: normal;
    }
    
    .history-delete {
        background: #fee2e2;
        color: #dc2626;
        border: none;
        padding: 0.75rem;
        border-radius: 0.5rem;
        font-size: 1.25rem;
        cursor: pointer;
        min-width: 3rem;
        min-height: 3rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .history-delete:hover {
        background: #fecaca;
    }
    
    .history-measurements {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .measurement-item {
        text-align: center;
        padding: 1rem;
        background: white;
        border-radius: 0.5rem;
        border: 1px solid #e2e8f0;
    }
    
    .measurement-label {
        font-size: 0.875rem;
        color: #64748b;
        font-weight: 500;
        margin-bottom: 0.5rem;
        display: block;
    }
    
    .measurement-value {
        font-size: 1.25rem;
        font-weight: 700;
        color: #1e293b;
        display: block;
    }
    
    .measurement-unit {
        font-size: 0.875rem;
        color: #64748b;
        font-weight: normal;
    }
    
    .measurement-na {
        font-size: 1rem;
        color: #64748b;
        font-style: italic;
    }
    
    /* Footer mobile */
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
        padding: 2rem 1rem;
    }
    
    .footer-left {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .footer-left .logo {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
    }
    
    .footer-left p {
        font-size: 1rem;
    }
    
    .footer-left small {
        font-size: 0.875rem;
    }
    
    .footer-right {
        flex-direction: column;
        gap: 1rem;
        font-size: 1rem;
    }
    
    /* Messages mobile */
    .success, .error {
        margin: 0 0.5rem 1rem 0.5rem;
        padding: 1.25rem;
        font-size: 1rem;
    }
    
    /* Empty state mobile */
    .empty-state {
        padding: 3rem 1rem;
        font-size: 1.125rem;
    }
}

/* Hide mobile history on desktop */
@media (min-width: 769px) {
    .mobile-history {
        display: none;
    }
}