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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    margin: 0;
}

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

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: white;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.tab-btn {
    flex: 1;
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.tab-content {
    display: none;
}

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

/* User Selector Styles */
.user-selector {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    color: white;
}

.user-selector h3 {
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.user-checkboxes {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.user-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.user-checkbox-label:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.user-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.user-checkbox-label:has(input[type="checkbox"]:checked) {
    background: white;
    color: #667eea;
    border-color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.tracking-user-selector {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.tracking-user-selector label {
    font-weight: 600;
    color: #333;
    margin-right: 10px;
}

.tracking-user-selector select {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.tracking-user-selector select:focus {
    outline: none;
    border-color: #667eea;
}

.comparison-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.user-comparison {
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.user-name {
    font-weight: 600;
    color: #667eea;
    font-size: 16px;
    margin-bottom: 10px;
}

.settings-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.calendar-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    padding: 30px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.nav-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

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

.month-year {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    text-align: center;
    flex: 1;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.weekday {
    text-align: center;
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
    padding: 10px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.day-cell {
    min-height: 100px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
}

.day-cell:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.day-cell.other-month {
    opacity: 0.4;
    background: #fafafa;
}

.day-cell.today {
    border-color: #667eea;
    background: #f0f4ff;
}

.day-number {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.medication-status-boxes {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
    align-content: flex-start;
}

.status-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.status-box.taken {
    background: #28a745;
}

.status-box.missed {
    background: #dc3545;
}

.status-box.pending {
    background: #ffc107;
    border-color: #ff9800;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h2 {
    color: #333;
    font-size: 24px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #333;
}

.medication-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid transparent;
}

.medication-item:hover {
    border-color: #667eea;
}

.medication-item-name {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.medication-item-details {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.delete-med-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.delete-med-btn:hover {
    background: #c82333;
    transform: scale(1.05);
}

.add-medication {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.frequency-settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.frequency-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.frequency-row label {
    font-weight: 600;
    color: #333;
    min-width: 120px;
    font-size: 14px;
}

.frequency-row select {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.frequency-row select:focus {
    outline: none;
    border-color: #667eea;
}

.day-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
}

.day-checkboxes label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
    min-width: auto;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 12px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.2s;
}

.day-checkboxes label:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.day-checkboxes input[type="checkbox"] {
    cursor: pointer;
}

.day-checkboxes input[type="checkbox"]:checked + span,
.day-checkboxes label:has(input[type="checkbox"]:checked) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

#newMedicationName {
    flex: 1;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

#newMedicationName:focus {
    outline: none;
    border-color: #667eea;
}

.add-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

/* Tracking Modal Styles */
.medication-tracking-item {
    padding: 20px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.medication-tracking-item h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.tracking-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.track-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s;
}

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

.track-btn.yes:hover {
    background: #218838;
    transform: translateY(-2px);
}

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

.track-btn.no:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.track-btn.active {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.timestamp-display {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.timestamp-display strong {
    color: #333;
}

.edit-timestamp {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.edit-timestamp input {
    padding: 8px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
}

.edit-timestamp input:focus {
    outline: none;
    border-color: #667eea;
}

.edit-timestamp button {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.edit-timestamp button:hover {
    background: #5568d3;
}

/* Data View Styles */
.data-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

.data-container h2 {
    color: #333;
    font-size: 28px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.data-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stat-card h3 {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    font-size: 12px;
    opacity: 0.8;
}

.medication-analytics {
    margin-bottom: 30px;
}

.medication-analytics h3 {
    color: #333;
    font-size: 20px;
    margin-bottom: 20px;
}

.medication-chart {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
}

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

.medication-chart-header h4 {
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.adherence-rate {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 15px;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
}

.chart-details {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.chart-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: white;
    border-radius: 6px;
    font-size: 14px;
}

.chart-detail-label {
    color: #666;
}

.chart-detail-value {
    font-weight: 600;
    color: #333;
}

.recent-entries h3 {
    color: #333;
    font-size: 20px;
    margin-bottom: 20px;
}

.entry-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.entry-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.entry-item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.entry-item-date {
    font-size: 12px;
    color: #666;
}

.entry-item-status {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.entry-item-status.taken {
    background: #28a745;
    color: white;
}

.entry-item-status.missed {
    background: #dc3545;
    color: white;
}

@media (max-width: 600px) {
    .calendar-container {
        padding: 15px;
    }
    
    .month-year {
        font-size: 22px;
    }
    
    .day-cell {
        min-height: 80px;
        padding: 6px;
    }
    
    .status-box {
        width: 16px;
        height: 16px;
    }
    
    .modal-content {
        padding: 20px;
    }

    .data-stats {
        grid-template-columns: 1fr;
    }

    .tab-btn {
        font-size: 14px;
        padding: 10px 16px;
    }
}

