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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
    -webkit-tap-highlight-color: transparent;
}

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

header {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.header-left {
    flex: 1;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-shrink: 0;
}

h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 10px;
    text-align: left;
}

/* Header App Info for Settings */
.header-app-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-app-icon {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.header-app-details {
    display: flex;
    flex-direction: column;
}

.header-app-name {
    font-size: 2.5rem;
    font-weight: bold;
    color: #333;
}

.header-app-version {
    font-size: 1rem;
    color: #666;
    margin-top: 5px;
}

.header-app-author {
    font-size: 1rem;
    color: #999;
    margin-top: 3px;
}

.date {
    font-size: 1.3rem;
    color: #666;
    font-weight: 500;
}

.date-picker-container {
    margin-top: 10px;
}

.date-picker {
    width: 100%;
    max-width: 300px;
    padding: 12px 15px;
    font-size: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: white;
    color: #333;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.date-picker:focus {
    outline: none;
    border-color: #6b7c93;
    box-shadow: 0 0 0 3px rgba(107, 124, 147, 0.1);
}

.summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.summary-item {
    background: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.summary-number {
    font-size: 3rem;
    font-weight: bold;
    color: #6b7c93;
}

.summary-label {
    font-size: 1.2rem;
    color: #666;
    margin-top: 5px;
}

.medications-list {
    margin-bottom: 20px;
}

/* Time container for grouping medications */
.time-container {
    margin-bottom: 25px;
}

.time-container-header {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 15px;
    padding: 12px 20px;
    background: #6b7c93;
    color: white;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Two-column grid for medications */
.meds-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

/* Single column on smaller screens */
@media (max-width: 768px) {
    .meds-grid {
        grid-template-columns: 1fr;
    }
}

.med-card {
    background: white;
    padding: 12px 12px 12px 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.med-card.taken {
    opacity: 0.6;
    background: #e8f5e9;
}

.med-card.inactive {
    opacity: 0.5;
    background: #f5f5f5;
}

.med-checkbox {
    min-width: 60px;
    height: 60px;
    border: 3px solid #6b7c93;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: all 0.3s ease;
    background: white;
}

.med-checkbox:active {
    transform: scale(0.95);
}

.med-card.taken .med-checkbox {
    background: #4caf50;
    border-color: #4caf50;
}

.med-info {
    flex: 1;
}

.med-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 8px;
}

.med-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.med-time-badge {
    background: #6b7c93;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 500;
}

.med-dosage {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 5px;
}

.med-notes {
    font-size: 1rem;
    color: #999;
    font-style: italic;
}

.med-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.icon-button {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    min-width: 50px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-button:active {
    transform: scale(0.9);
}

.icon-button.edit-button:active {
    background: #fff3cd;
}

.icon-button.delete-button:active {
    background: #ffebee;
}

.action-button {
    padding: 15px 20px;
    background: white;
    border: 2px solid #6b7c93;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #6b7c93;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.action-button:active {
    transform: scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.action-button.secondary {
    border: 2px solid #5cb85c;
    color: #5cb85c;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.action-button.secondary:active {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.add-button {
    width: 100%;
    padding: 25px;
    background: white;
    border: 2px dashed #6b7c93;
    border-radius: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #6b7c93;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-button:active {
    transform: scale(0.98);
    background: #f0f0f0;
}

.secondary-button {
    background: white;
    border: 3px solid #4caf50;
    color: #4caf50;
    margin-top: 10px;
}

.secondary-button:active {
    background: #e8f5e9;
}

.section-header {
    font-size: 1.4rem;
    font-weight: bold;
    color: #6b7c93;
    margin: 20px 0 15px 0;
    padding: 10px 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.as-needed-log {
    background: #fff3e0;
    border-left: 6px solid #ff9800;
}

.as-needed-badge {
    background: #ff9800;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 8px;
}

.med-time-taken {
    font-size: 1.1rem;
    color: #666;
    margin-top: 5px;
}

/* Pill Organizer Button */
.pill-organizer-button {
    width: 100%;
    background: white;
    border: 3px solid #667eea;
    border-radius: 20px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.pill-organizer-button:hover {
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.pill-organizer-button:active {
    transform: scale(0.98);
}

.organizer-label {
    text-align: center;
    font-size: 1.4rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 15px;
}

.pill-organizer {
    width: 100%;
    height: auto;
    display: block;
}

.pill-slot {
    fill: #f0f0f0;
    stroke: #667eea;
    stroke-width: 2;
    transition: all 0.3s ease;
}

.pill-organizer-button:hover .pill-slot {
    fill: #e8eeff;
}

.day-label, .time-label {
    fill: #667eea;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    text-anchor: middle;
}

.time-label {
    font-size: 12px;
    text-anchor: start;
}

.pill-visual {
    fill: #667eea;
    opacity: 0.6;
}

/* Responsive sizing for pill organizer */
@media (max-width: 768px) {
    .organizer-label {
        font-size: 1.2rem;
    }
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.med-list-container {
    margin-bottom: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.med-list-item {
    background: white;
    padding: 20px;
    margin-bottom: 12px;
    border-radius: 12px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.med-list-item:hover {
    border-color: #6b7c93;
    background: #f8f9fa;
}

.med-list-item:active {
    transform: scale(0.98);
}

.med-list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 8px;
}

.med-list-item-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
}

.med-list-item-dosage {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 8px;
}

.med-list-item-schedule {
    font-size: 1rem;
    color: #999;
}

.med-list-item-times {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.med-list-time-badge {
    background: #6b7c93;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
}

.empty-med-list {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 1.2rem;
}

.modal-content h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #6b7c93;
}

.form-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 25px;
}

.cancel-button,
.save-button {
    padding: 18px;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-button {
    background: #ddd;
    color: #666;
}

.save-button {
    background: #6b7c93;
    color: white;
}

.cancel-button:active,
.save-button:active {
    transform: scale(0.95);
}

.stop-med-button {
    width: 100%;
    padding: 18px;
    background: white;
    border: 2px solid #dc3545;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #dc3545;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.stop-med-button:active {
    transform: scale(0.95);
    background: #fff0f0;
}

.empty-state {
    background: white;
    padding: 50px 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.empty-state-text {
    font-size: 1.3rem;
    color: #999;
}

/* Tabs */
.tabs {
    display: grid;
    grid-template-columns: auto 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-button {
    padding: 18px;
    background: white;
    border: none;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.tab-button.active {
    background: #6b7c93;
    color: white;
    box-shadow: 0 3px 8px rgba(107, 124, 147, 0.3);
}

.tab-button:active {
    transform: scale(0.98);
}

.tab-button.settings-button {
    font-size: 1.8rem;
    padding: 18px 22px;
    min-width: auto;
}

.tab-button.settings-button:active {
    transform: scale(0.95);
}

.tab-content {
    display: none;
}

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

/* Appointments Filter */
.appointments-filter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-button {
    padding: 15px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-button.active {
    background: #6b7c93;
    color: white;
    border-color: #6b7c93;
}

.filter-button:active {
    transform: scale(0.98);
}

/* Appointments List */
.appointments-list {
    margin-bottom: 20px;
}

.appt-card {
    background: white;
    padding: 25px;
    margin-bottom: 15px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 6px solid #6b7c93;
}

.appt-card.past {
    opacity: 0.7;
    border-left-color: #999;
}

.appt-card.completed {
    background: #e8f5e9;
    border-left-color: #4caf50;
}

.appt-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.appt-type-badge {
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.appt-type-badge.doctor {
    background: #2196f3;
}

.appt-type-badge.infusion {
    background: #9c27b0;
}

.appt-type-badge.lab {
    background: #ff9800;
}

.appt-type-badge.procedure {
    background: #f44336;
}

.appt-type-badge.other {
    background: #607d8b;
}

.appt-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.appt-datetime {
    font-size: 1.3rem;
    color: #6b7c93;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.appt-location {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.appt-address {
    font-size: 1.1rem;
    color: #999;
    margin-bottom: 10px;
}

.appt-notes {
    font-size: 1.1rem;
    color: #666;
    font-style: italic;
    background: #f5f5f5;
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
}

.appt-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.complete-button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #4caf50;
    color: white;
}

.complete-button:active {
    transform: scale(0.95);
}

.appt-card.completed .complete-button {
    background: #ddd;
    color: #999;
}

/* Form textarea */
.form-group textarea {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
    resize: vertical;
}

.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Times selector */
.times-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.time-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.time-checkbox input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.time-checkbox:has(input:checked) {
    background: #6b7c93;
    color: white;
    border-color: #6b7c93;
}

.time-checkbox:active {
    transform: scale(0.98);
}

/* Specific times */
.specific-times-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.specific-time-item {
    display: grid;
    grid-template-columns: auto 1fr 2fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
}

.specific-time-item label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #666;
    white-space: nowrap;
}

.specific-time-item input[type="time"] {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
}

.specific-time-item select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
}

.remove-specific-time {
    padding: 6px 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s ease;
}

.remove-specific-time:hover {
    background: #c82333;
}

.add-specific-time-button {
    margin-top: 12px;
    padding: 10px 16px;
    background: white;
    color: #6b7c93;
    border: 2px dashed #6b7c93;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-specific-time-button:hover {
    background: #f8f9fa;
    border-color: #5a6a7f;
    color: #5a6a7f;
}

/* Days selector */
.days-selector {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.day-checkbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.day-checkbox input[type="checkbox"] {
    margin-bottom: 5px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.day-checkbox:has(input:checked) {
    background: #6b7c93;
    color: white;
    border-color: #6b7c93;
}

.day-checkbox:active {
    transform: scale(0.95);
}

/* Schedule badge */
.med-schedule {
    font-size: 0.95rem;
    color: #999;
    margin-top: 5px;
}

.med-schedule.inactive {
    color: #f44336;
    font-weight: 600;
}

/* Log entries */
.log-entries {
    margin-bottom: 20px;
}

.log-card {
    background: white;
    padding: 25px;
    margin-bottom: 15px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 6px solid #6b7c93;
}

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

.log-datetime {
    font-size: 1.3rem;
    font-weight: 600;
    color: #6b7c93;
}

.log-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.log-metric {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.log-metric-label {
    font-size: 0.9rem;
    color: #999;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.log-metric-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.log-metric-unit {
    font-size: 0.9rem;
    color: #666;
    margin-left: 4px;
}

.log-notes-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.log-notes-label {
    font-size: 0.9rem;
    color: #999;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.log-notes-content {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.5;
}

.log-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.log-edit-button,
.log-delete-button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.log-edit-button {
    background: #6b7c93;
    color: white;
}

.log-delete-button {
    background: #dc3545;
    color: white;
}

.log-edit-button:active,
.log-delete-button:active {
    transform: scale(0.95);
}

.empty-log {
    text-align: center;
    padding: 50px 30px;
    color: #999;
    font-size: 1.2rem;
}

/* Log metric group with checkbox */
.log-metric-group {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.log-metric-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    min-width: 200px;
}

.log-metric-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.log-metric-checkbox span {
    cursor: pointer;
}

.log-metric-group input[type="number"] {
    flex: 1;
    max-width: 150px;
    padding: 12px 15px;
    font-size: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
}

.log-metric-group textarea {
    flex: 1;
    padding: 12px 15px;
    font-size: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
}

.log-metric-group input[type="number"]:disabled,
.log-metric-group textarea:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.log-metric-group input[type="number"]:not(:disabled),
.log-metric-group textarea:not(:disabled) {
    background: white;
}

.log-metric-group input[type="number"]:focus,
.log-metric-group textarea:focus {
    outline: none;
    border-color: #6b7c93;
}

/* Settings Section */
.settings-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.settings-section-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.settings-section-desc {
    font-size: 1rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Time & Alarm Settings Combined */
.time-alarm-settings {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.time-alarm-group {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e0e0e0;
}

.time-alarm-heading {
    font-size: 1.2rem;
    font-weight: 700;
    color: #6b7c93;
    margin: 0 0 15px 0;
}

.time-alarm-controls {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 15px;
    align-items: end;
}

.time-alarm-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-setting-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
}

.time-setting-input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.time-setting-input:focus {
    outline: none;
    border-color: #6b7c93;
}

.time-setting-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
}

.alarm-sound-select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    width: 100%;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.alarm-sound-select:focus {
    outline: none;
    border-color: #6b7c93;
}

.test-alarm-button {
    padding: 12px 20px;
    background: white;
    border: 2px solid #6b7c93;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #6b7c93;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.test-alarm-button:hover {
    background: #6b7c93;
    color: white;
}

.test-alarm-button:active {
    transform: scale(0.98);
}

/* App Info Section */
.app-info-section {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.app-icon {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.app-details {
    display: flex;
    flex-direction: column;
}

.app-name {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

.app-version {
    font-size: 1rem;
    color: #666;
    margin-top: 5px;
}

.app-author {
    font-size: 1rem;
    color: #999;
    margin-top: 3px;
}

.settings-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.settings-option {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 10px 15px;
    align-items: start;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-option:hover {
    border-color: #6b7c93;
    background: #f8f9fa;
}

.settings-option input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    margin-top: 2px;
    grid-row: 1 / 3;
}

.settings-option-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    grid-column: 2;
    grid-row: 1;
}

.settings-option-desc {
    font-size: 1rem;
    color: #666;
    grid-column: 2;
    grid-row: 2;
}

/* Language Select */
.language-select {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 12px;
    background: white;
    color: #333;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}

.language-select:focus {
    outline: none;
    border-color: #6b7c93;
    box-shadow: 0 0 0 3px rgba(107, 124, 147, 0.1);
}

/* Settings Sub-options */
.settings-sub-options {
    margin-top: 15px;
    padding-left: 40px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.settings-sub-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.settings-sub-option:hover {
    background: #e9ecef;
    border-color: #6b7c93;
}

.settings-sub-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.settings-sub-option label {
    font-size: 1.1rem;
    color: #333;
    cursor: pointer;
    margin: 0;
}

/* Settings Data Management Buttons */
.settings-data-button {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.settings-data-button:active {
    transform: scale(0.98);
}

.settings-data-button.export-button {
    border-color: #6b7c93;
}

.settings-data-button.export-button:active {
    background: #f0f4f8;
}

.settings-data-button.import-button {
    border-color: #5cb85c;
}

.settings-data-button.import-button:active {
    background: #f0f8f0;
}

.settings-data-button.clear-button {
    border-color: #dc3545;
}

.settings-data-button.clear-button:active {
    background: #fff0f0;
}

.settings-data-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.settings-data-content {
    flex: 1;
}

.settings-data-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.settings-data-desc {
    font-size: 1rem;
    color: #666;
}

/* Data management modal (legacy - keeping for compatibility) */
.data-management-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.data-button {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.data-button:active {
    transform: scale(0.98);
}

.data-button.export-button {
    border-color: #6b7c93;
}

.data-button.export-button:active {
    background: #f0f4f8;
}

.data-button.import-button {
    border-color: #5cb85c;
}

.data-button.import-button:active {
    background: #f0f8f0;
}

.data-button.clear-button {
    border-color: #dc3545;
}

.data-button.clear-button:active {
    background: #fff0f0;
}

.data-button-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.data-button-content {
    flex: 1;
}

.data-button-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.data-button-desc {
    font-size: 1rem;
    color: #666;
}

/* Weekly view modal */
.weekly-view-content {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
}

.weekly-view-header {
    margin-bottom: 1px;
}

.weekly-nav {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.weekly-nav-button {
    padding: 10px 20px;
    color: #6b7c93;
    background: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.weekly-nav-button:active {
    transform: scale(0.95);
}

.weekly-schedule {
    overflow-x: auto;
    margin-bottom: 1px;
}

.weekly-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 5px;
}

.weekly-day-header {
    color: #6b7c93;
    background: white;
    font-weight: bold;
    padding: 1px;
    text-align: center;    
    text-transform: uppercase;
    border-radius: 8px;
    font-size: 1.3rem;
}

.weekly-time-row {
    margin-bottom: 5px;
}

.weekly-time-header-full {
    background: #b4bfce;
    color: white;
    font-weight: bold;
    padding: 0px;
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 3px;
    border-radius: 8px;
    font-size: .7rem;
}

.weekly-time-columns {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.weekly-day-column {
    border: 0px solid #ddd;
    border-radius: 8px;
    padding: 1px;
    background: #fff;
    min-height: 20px;
}

.weekly-med-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 5px;
    border-bottom: 1px solid #f0f0f0;
}

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

.weekly-med-item.taken {
    background: #e8f5e9;
}

.weekly-med-item.taken .weekly-med-label {
    color: #2e7d32;
}

.weekly-checkbox {
    width: 18px;
    height: 18px;
    cursor: default;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #28a745;
}

.weekly-med-label {
    font-size: 0.85rem;
    line-height: 1.3;
}

/* Print styles - Weekly View Modal */
@media print {
    /* Hide everything except the weekly view modal when it's active */
    body.printing-weekly * {
        visibility: hidden !important;
    }

    body.printing-weekly #weeklyViewModal,
    body.printing-weekly #weeklyViewModal * {
        visibility: visible !important;
    }

    body.printing-weekly #weeklyViewModal {
        display: block !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body.printing-weekly #weeklyViewModal .modal-content {
        display: block !important;
        box-shadow: none !important;
        max-width: 100% !important;
        max-height: none !important;
        height: auto !important;
        padding: 10px !important;
        margin: 0 !important;
        transform: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
        position: static !important;
    }

    body.printing-weekly .weekly-view-content {
        display: block !important;
        overflow: visible !important;
        max-height: none !important;
    }

    /* Hide the header with navigation buttons */
    body.printing-weekly .weekly-view-header {
        display: none !important;
        visibility: hidden !important;
    }

    body.printing-weekly .weekly-nav {
        display: none !important;
        visibility: hidden !important;
    }

    /* Hide close and print buttons */
    body.printing-weekly #weeklyViewCloseButton,
    body.printing-weekly #weeklyViewPrintButton,
    body.printing-weekly .weekly-nav-button {
        display: none !important;
        visibility: hidden !important;
    }

    body.printing-weekly .weekly-schedule {
        display: block !important;
        overflow: visible !important;
    }

    body.printing-weekly #weeklyViewContainer {
        display: block !important;
    }

    /* Preserve grid layout for header row */
    body.printing-weekly .weekly-header-row {
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
        gap: 5px !important;
        margin-bottom: 5px !important;
    }

    /* Each time section */
    body.printing-weekly .weekly-time-row {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 5px !important;
    }

    body.printing-weekly .weekly-time-header-full {
        display: block !important;
        padding: 5px 10px !important;
        font-size: 0.9rem !important;
    }

    /* Grid for day columns within each time row */
    body.printing-weekly .weekly-time-columns {
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
        gap: 5px !important;
    }

    body.printing-weekly .weekly-day-column {
        display: block !important;
        padding: 3px !important;
        min-height: auto !important;
    }

    body.printing-weekly .weekly-day-header {
        display: block !important;
        text-align: center !important;
        font-size: 0.8rem !important;
        padding: 3px !important;
    }

    body.printing-weekly .weekly-med-item {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        padding: 2px 4px !important;
        font-size: 0.75rem !important;
    }

    body.printing-weekly .weekly-checkbox {
        display: inline-block !important;
        width: 12px !important;
        height: 12px !important;
    }

    body.printing-weekly .weekly-med-label {
        display: inline !important;
        font-size: 0.75rem !important;
    }

    /* Landscape orientation and page margins */
    @page {
        size: landscape;
        margin: 0.3in;
    }
}

/* Responsive adjustments for smaller screens */
/* Mobile styles for phones */
@media (max-width: 600px) {
    /* Reduce overall spacing */
    body {
        padding: 8px;
    }

    header {
        padding: 15px;
        margin-bottom: 15px;
        gap: 12px;
    }

    /* Stack header items vertically */
    header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-left {
        width: 100%;
    }

    .header-actions {
        width: 100%;
        justify-content: stretch;
    }

    /* Make buttons fill width on mobile */
    .action-button {
        flex: 1;
        font-size: 1rem;
        padding: 12px 16px;
    }

    /* Smaller text for mobile */
    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    /* Tabs */
    .tabs {
        padding: 6px;
        gap: 4px;
    }

    .tab-button {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    /* Tab content */
    .tab-content {
        padding: 12px;
    }

    /* Modal adjustments */
    .modal {
        padding: 8px;
    }

    .modal-content {
        padding: 20px;
        max-height: 92vh;
        overflow-y: auto;
    }

    .modal-content h2 {
        font-size: 1.4rem;
    }

    /* Form elements */
    .form-group {
        margin-bottom: 12px;
    }

    .form-group label {
        font-size: 0.95rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 1rem;
        padding: 10px;
    }

    /* Buttons in forms */
    .form-buttons button {
        font-size: 1rem;
        padding: 12px;
    }

    /* Date picker */
    .date-picker {
        font-size: 1rem;
    }

    /* Time & Alarm Settings - stack vertically on mobile */
    .time-alarm-group {
        padding: 15px;
    }

    .time-alarm-heading {
        font-size: 1.1rem;
    }

    .time-alarm-controls {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .test-alarm-button {
        width: 100%;
    }

    /* Make checkboxes easier to tap */
    .time-checkbox,
    .day-checkbox {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    /* Card spacing */
    .med-card,
    .appt-card,
    .metric-card {
        margin-bottom: 12px;
        padding: 12px;
    }

    /* Metrics header adjustments */
    .metrics-header-top {
        gap: 10px;
        margin-bottom: 12px;
    }

    .metrics-header-top h1 {
        font-size: 1.8rem;
    }

    /* Metrics date controls - stack vertically */
    .metrics-date-controls {
        flex-direction: column;
        gap: 10px;
    }

    .metrics-date-range {
        width: 100%;
        min-width: auto;
    }

    .metrics-filter-wrapper {
        width: 100%;
    }

    .metrics-filter-button {
        width: 100%;
    }
}

/* iOS Install Modal */
.ios-install-content {
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
}

.ios-install-intro {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 4px solid #2196f3;
}

.ios-install-intro p {
    font-size: 1.15rem;
    color: #1565c0;
    line-height: 1.6;
    margin: 0;
}

.ios-install-steps,
.ios-install-data-transfer,
.ios-install-benefits {
    margin-bottom: 25px;
}

.ios-install-steps h3,
.ios-install-data-transfer h3,
.ios-install-benefits h3 {
    font-size: 1.4rem;
    color: #6b7c93;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.ios-install-steps ol,
.ios-install-data-transfer ol {
    list-style: none;
    counter-reset: step-counter;
    padding-left: 0;
}

.ios-install-steps ol li,
.ios-install-data-transfer ol li {
    counter-increment: step-counter;
    margin-bottom: 20px;
    padding-left: 45px;
    position: relative;
}

.ios-install-steps ol li::before,
.ios-install-data-transfer ol li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: #6b7c93;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.ios-install-steps ol li strong,
.ios-install-data-transfer ol li strong {
    display: block;
    font-size: 1.15rem;
    color: #333;
    margin-bottom: 8px;
}

.ios-instruction-detail {
    font-size: 1rem;
    color: #666;
    line-height: 1.5;
    margin-top: 6px;
}

.share-icon {
    display: inline-block;
    font-size: 1.3rem;
    color: #2196f3;
    font-weight: bold;
    padding: 2px 6px;
    background: #e3f2fd;
    border-radius: 4px;
}

.ios-install-data-transfer p {
    font-size: 1.05rem;
    color: #555;
    margin-bottom: 15px;
    font-style: italic;
}

.ios-install-benefits ul {
    list-style: none;
    padding-left: 0;
}

.ios-install-benefits ul li {
    padding: 10px 15px 10px 40px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    position: relative;
    font-size: 1.05rem;
    color: #444;
}

.ios-install-benefits ul li::before {
    content: "✓";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #4caf50;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Alarm Reminder Modal */
.alarm-reminder-content {
    max-width: 500px;
    text-align: center;
    animation: alarmPulse 1s ease-in-out infinite;
}

@keyframes alarmPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.alarm-reminder-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    border-radius: 12px 12px 0 0;
    margin: -30px -30px 0 -30px;
}

.alarm-reminder-header h2 {
    margin: 0;
    font-size: 2rem;
    color: white;
}

.alarm-reminder-body {
    padding: 30px 20px;
}

.alarm-time-label {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 15px;
    text-transform: capitalize;
}

.alarm-message {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
}

.alarm-reminder-footer {
    padding: 0 20px 20px;
}

.alarm-acknowledge-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.alarm-acknowledge-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.alarm-acknowledge-button:active {
    transform: translateY(0);
}

/* Print Preview Modal */
.print-preview-content {
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
}

.print-content {
    background: white;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
}

.print-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #6b7c93;
    padding-bottom: 15px;
}

.print-header h3 {
    margin: 0 0 10px 0;
    color: #6b7c93;
    font-size: 1.8rem;
}

.print-date-range {
    font-size: 1.1rem;
    color: #666;
    margin: 5px 0;
}

.print-entry {
    margin-bottom: 20px;
    padding: 15px;
    border-left: 4px solid #6b7c93;
    background: #f8f9fa;
}

.print-entry-date {
    font-weight: bold;
    color: #6b7c93;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.print-metric-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 15px;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.print-metric-row:last-child {
    border-bottom: none;
}

.print-metric-label {
    font-weight: 600;
    color: #555;
}

.print-metric-value {
    color: #333;
}

.print-notes {
    margin-top: 10px;
    padding: 10px;
    background: white;
    border-radius: 5px;
    font-style: italic;
    color: #666;
}

/* Compact Print Format */
.print-entry-compact {
    margin-bottom: 8px;
    padding: 8px 12px;
    border-left: 3px solid #6b7c93;
    background: #f8f9fa;
    line-height: 1.6;
}

.print-entry-date-compact {
    font-weight: bold;
    color: #6b7c93;
    font-size: 0.95rem;
}

.print-metrics-line {
    color: #333;
    font-size: 0.95rem;
}

.print-notes-compact {
    display: block;
    margin-top: 4px;
    padding: 4px 8px;
    background: white;
    border-radius: 4px;
    font-size: 0.85rem;
    font-style: italic;
    color: #666;
}

/* Print-specific styles for Metrics Print Modal */
@media print {
    /* Hide everything by default - but only when NOT printing weekly view */
    body:not(.printing-weekly) * {
        visibility: hidden !important;
        display: none !important;
    }

    /* Show only the metrics print modal and its content */
    body:not(.printing-weekly) #metricsPrintModal,
    body:not(.printing-weekly) #metricsPrintModal *,
    body:not(.printing-weekly) #printPreviewContent,
    body:not(.printing-weekly) #printPreviewContent * {
        display: block !important;
        visibility: visible !important;
    }

    /* Position the content at the top of the page */
    body:not(.printing-weekly) #printPreviewContent {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* Hide the modal wrapper, title, and buttons during print */
    body:not(.printing-weekly) #metricsPrintModal {
        position: static !important;
        background: none !important;
    }

    body:not(.printing-weekly) #metricsPrintModal .modal-content {
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
    }

    body:not(.printing-weekly) #metricsPrintModal h2,
    body:not(.printing-weekly) #metricsPrintModal .form-buttons {
        display: none !important;
    }

    /* Avoid page breaks inside entries */
    .print-entry,
    .print-entry-compact {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Keep header with first entry */
    .print-header {
        page-break-after: avoid;
        break-after: avoid;
    }

    /* Remove extra backgrounds and borders for print */
    .print-content {
        background: white !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* iPad specific optimizations */
@media (min-width: 768px) {
    h1 {
        font-size: 3rem;
    }

    .summary-number {
        font-size: 3.5rem;
    }

    .med-name {
        font-size: 1.7rem;
    }

    .appt-title {
        font-size: 1.7rem;
    }

    .action-button {
        font-size: 1.2rem;
        padding: 16px 24px;
    }
}

/* Profile Management */
.profile-modal-content {
    max-width: 500px;
}

.profile-modal-desc {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.profile-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.profile-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-item:hover {
    background: #e9ecef;
    border-color: #6b7c93;
}

.profile-item.active {
    background: #6b7c93;
    border-color: #6b7c93;
    color: white;
}

.profile-item-info {
    flex: 1;
}

.profile-item-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-item.active .profile-item-name {
    color: white;
}

.profile-item-meta {
    font-size: 0.85rem;
    color: #666;
}

.profile-item.active .profile-item-meta {
    color: rgba(255, 255, 255, 0.9);
}

.profile-item-actions {
    display: flex;
    gap: 8px;
}

.profile-delete-button {
    padding: 6px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.profile-delete-button:hover {
    background: #c82333;
}

.profile-item.active .profile-delete-button {
    background: rgba(220, 53, 69, 0.9);
}

.profile-item.active .profile-delete-button:hover {
    background: rgba(200, 35, 51, 0.9);
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.add-profile-button {
    padding: 12px 24px;
    background: white;
    color: #6b7c93;
    border: 2px dashed #6b7c93;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-profile-button:hover {
    background: #f8f9fa;
    border-color: #5a6a7f;
    color: #5a6a7f;
}

.import-profile-button {
    padding: 12px 24px;
    background: #e8f4fd;
    color: #1976d2;
    border: 2px solid #1976d2;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.import-profile-button:hover {
    background: #1976d2;
    color: white;
}

/* Current Profile Display in Settings */
.current-profile-display {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
}

.current-profile-info {
    flex: 1;
}

.current-profile-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #6b7c93;
    margin-bottom: 4px;
}

.current-profile-desc {
    font-size: 0.9rem;
    color: #666;
}

@media (max-width: 600px) {
    .current-profile-display {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .profile-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Sync UI Styles */
.sync-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e0e0e0;
}

/* Synced Profile Section */
.sync-connected-info {
    background: #e8f5e9;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #81c784;
}

.sync-status-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.synced-profile-details {
    margin-left: 24px;
}

.synced-profile-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2e7d32;
    margin-bottom: 8px;
}

.synced-profile-desc {
    font-size: 0.95rem;
    color: #1b5e20;
    line-height: 1.5;
}

.sync-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.sync-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.sync-status-indicator.online {
    background: #28a745;
}

.sync-status-indicator.offline {
    background: #dc3545;
    animation: none;
}

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

.sync-status-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #666;
}

.sync-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sync-button {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.sync-button.primary {
    border-color: #6b7c93;
}

.sync-button.primary:hover {
    background: #6b7c93;
    color: white;
}

.sync-button.primary:hover .sync-button-title,
.sync-button.primary:hover .sync-button-desc {
    color: white;
}

.sync-button.secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.sync-button.danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
    justify-content: center;
    margin-top: 20px;
}

.sync-button.danger:hover {
    background: #c82333;
    border-color: #c82333;
}

.sync-button-icon {
    font-size: 1.8rem;
}

.sync-button-content {
    flex: 1;
    text-align: left;
}

.sync-button-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.sync-button-desc {
    font-size: 0.9rem;
    color: #666;
}

.sync-qr-container {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 10px;
}

.sync-qr-instructions {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 15px;
}

.sync-qr-canvas {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 15px;
    padding: 10px;
    background: white;
    border: 3px solid #6b7c93;
    border-radius: 10px;
}

.sync-qr-canvas img {
    display: block;
    border-radius: 5px;
}

.sync-code-text {
    font-size: 1rem;
    color: #666;
    margin-top: 10px;
}

.sync-code-text strong {
    font-family: monospace;
    font-size: 1.3rem;
    color: #6b7c93;
    letter-spacing: 2px;
}

.sync-connected-devices {
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 10px;
}

.sync-devices-title {
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
}

.sync-devices-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sync-device-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.95rem;
}

.sync-device-icon {
    font-size: 1.2rem;
}

.sync-device-name {
    flex: 1;
    font-weight: 600;
    color: #333;
}

.sync-device-status {
    font-size: 0.85rem;
    color: #28a745;
}

.sync-no-devices {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
}

.sync-peer-info {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.sync-peer-detail {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.sync-peer-detail:last-child {
    border-bottom: none;
}

.sync-peer-label {
    font-weight: 600;
    color: #666;
}

.sync-peer-value {
    color: #333;
    font-weight: 500;
}

.sync-online {
    color: #28a745;
}

@media (max-width: 600px) {
    .sync-button-icon {
        font-size: 1.5rem;
    }

    .sync-button-title {
        font-size: 1rem;
    }

    .sync-button-desc {
        font-size: 0.85rem;
    }

    .sync-qr-canvas {
        max-width: 200px;
    }
}
