/* Elderly-Friendly Medical Application Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    background-color: #f8f9fa;
    color: #212529;
    min-height: 100vh;
}

/* Container and layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    padding: 25px;
}

.card-header {
    background-color: #007bff;
    color: white;
    padding: 20px 25px;
    margin: -25px -25px 25px -25px;
    border-radius: 6px 6px 0 0;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
}

/* Typography - Large and clear */
h1 {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 25px;
    text-align: center;
    color: #007bff;
}

h2 {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #007bff;
    border-bottom: 3px solid #007bff;
    padding-bottom: 10px;
}

h3 {
    font-size: 22px;
    font-weight: bold;
    margin: 20px 0 15px 0;
    color: #495057;
    background-color: #e9ecef;
    padding: 10px 15px;
    border-left: 5px solid #007bff;
}

/* Form elements - Large and accessible */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #495057;
}

.required {
    color: #dc3545;
    font-size: 18px;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="tel"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border: 3px solid #ced4da;
    border-radius: 8px;
    background-color: white;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.3);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* Radio buttons and checkboxes - Larger */
.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 10px;
}

.radio-item,
.checkbox-item {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.radio-item:hover,
.checkbox-item:hover {
    background-color: #e9ecef;
    border-color: #007bff;
}

.radio-item input[type="radio"],
.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

.radio-item label,
.checkbox-item label {
    margin: 0;
    cursor: pointer;
    font-size: 16px;
}

/* Buttons - Large and prominent */
.btn {
    display: inline-block;
    padding: 18px 35px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px 5px;
    min-width: 180px;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

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

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #1e7e34;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

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

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

/* Navigation */
.navbar {
    background-color: #007bff;
    padding: 20px 0;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    color: white;
    font-size: 28px;
    font-weight: bold;
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 18px;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.2);
}

/* Dashboard menu */
.dashboard-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.menu-item {
    background: white;
    border: 3px solid #007bff;
    border-radius: 12px;
    padding: 35px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: #212529;
    display: block;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.menu-item:hover {
    background-color: #007bff;
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
    text-decoration: none;
}

.menu-item h3 {
    font-size: 24px;
    margin-bottom: 15px;
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

.menu-item p {
    font-size: 18px;
    line-height: 1.5;
}

/* Login page */
.login-container {
    max-width: 500px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-header h1 {
    color: #007bff;
    font-size: 32px;
}

.login-header p {
    font-size: 18px;
    color: #6c757d;
    margin-top: 10px;
}

/* Alerts */
.alert {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 18px;
    font-weight: bold;
}

.alert-error {
    background-color: #f8d7da;
    border: 2px solid #f5c6cb;
    color: #721c24;
}

.alert-success {
    background-color: #d4edda;
    border: 2px solid #c3e6cb;
    color: #155724;
}

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

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    margin-top: 20px;
    background: white;
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border: 2px solid #dee2e6;
}

.table th {
    background-color: #007bff;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.table tbody tr:hover {
    background-color: #e3f2fd;
}

/* File upload */
.file-upload-area {
    border: 3px dashed #007bff;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    background-color: #f8f9ff;
    margin: 20px 0;
    transition: all 0.3s ease;
}

.file-upload-area:hover {
    background-color: #e3f2fd;
    border-color: #0056b3;
}

.file-upload-area input[type="file"] {
    font-size: 18px;
    padding: 10px;
}

.file-list {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #dee2e6;
}

.file-item:last-child {
    border-bottom: none;
}

.file-preview {
    max-width: 200px;
    max-height: 150px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    margin: 10px 0;
}

/* Form sections */
.form-section {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
}

.form-section h3 {
    background-color: #007bff;
    color: white;
    margin: -25px -25px 25px -25px;
    padding: 15px 25px;
    border-radius: 6px 6px 0 0;
    font-size: 20px;
}

/* Grid layouts */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-col-2 {
    grid-template-columns: 1fr 1fr;
}

.form-col-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .dashboard-menu {
        grid-template-columns: 1fr;
    }
    
    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn {
        min-width: auto;
        width: 100%;
        margin: 5px 0;
    }
    
    h1 {
        font-size: 28px;
    }
    
    h2 {
        font-size: 24px;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .file-upload-area {
        display: none;
    }
    
    body {
        font-size: 12px;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
*:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 3px solid #000;
    }
    
    .btn-primary {
        background-color: #000;
        border: 2px solid #fff;
    }
    
    .form-control {
        border: 2px solid #000;
    }
}