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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1, h2, h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

button {
    cursor: pointer;
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

nav button {
    margin-left: 10px;
}

nav button.active {
    background-color: #2c3e50;
}

/* View Styles */
.view {
    display: none;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.view.active {
    display: block;
}

/* Section Header Styles */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h3 {
    margin-bottom: 0;
}

#newMedicationBtn {
    background-color: #27ae60;
}

#newMedicationBtn:hover {
    background-color: #219955;
}

#printCalendarBtn {
    background-color: #3498db;
}

#printCalendarBtn:hover {
    background-color: #2980b9;
}

/* Form Styles */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input, select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

small {
    display: block;
    color: #7f8c8d;
    margin-top: 5px;
    font-size: 12px;
}

.hidden {
    display: none;
}

/* Calendar Styles */
.calendar-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

#prevPeriodBtn, #nextPeriodBtn, #todayBtn {
    background-color: #3498db;
    padding: 8px 15px;
}

#prevPeriodBtn:hover, #nextPeriodBtn:hover, #todayBtn:hover {
    background-color: #2980b9;
}

#todayBtn {
    background-color: #27ae60; /* Green color to make it stand out */
}

#todayBtn:hover {
    background-color: #219955;
}

#calendarContainer {
    margin-top: 20px;
}

.calendar-day {
    display: flex;
    padding: 10px;
    border-bottom: 1px solid #eee;
    align-items: flex-start; /* Align to top */
}

/* Alternating colors for calendar days */
.calendar-day:nth-child(odd) {
    background-color: #f9f9f9;
}

.calendar-day:nth-child(even) {
    background-color: #ffffff;
}

.calendar-day.today {
    background-color: #e8f4fc;
}

.calendar-date {
    width: 150px;
    font-weight: bold;
    padding-top: 5px; /* Add some padding to align with checkboxes */
    display: flex;
    flex-direction: column;
}

.calendar-medications {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.medication-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    width: 100%; /* Full width for alignment */
}

.medication-item input[type="checkbox"] {
    margin: 0;
    flex: 0 0 20px; /* Fixed width for checkboxes */
}

.medication-item label {
    margin-left: 10px;
    margin-bottom: 0;
    flex: 1; /* Take remaining space */
}

.med-icon {
    display: inline-block;
    margin-left: 5px;
    font-size: 14px;
}

.first-day-icon {
    color: #e74c3c; /* Red color for first day */
}

.last-day-icon {
    color: #27ae60; /* Green color for last day */
}

/* Medication List Styles */
.medication-list {
    margin-top: 30px;
}

.show-old-meds-container {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.show-old-meds-container input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    flex: 0 0 20px;
}

.show-old-meds-container label {
    margin-bottom: 0;
    font-weight: normal;
    display: inline;
}

#medicationList {
    list-style: none;
}

#medicationList li {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.medication-actions {
    display: flex;
    gap: 5px;
}

.edit-med-btn {
    background-color: #3498db;
    padding: 5px 10px;
    font-size: 12px;
}

.edit-med-btn:hover {
    background-color: #2980b9;
}

.delete-med-btn {
    background-color: #e74c3c;
    padding: 5px 10px;
    font-size: 12px;
}

.delete-med-btn:hover {
    background-color: #c0392b;
}

/* Data Management Styles */
.data-management {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.data-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.import-container {
    position: relative;
}

#exportDataBtn {
    background-color: #27ae60;
}

#exportDataBtn:hover {
    background-color: #219955;
}

#importDataBtn {
    background-color: #f39c12;
}

#importDataBtn:hover {
    background-color: #e67e22;
}

/* Responsive Styles */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    nav {
        margin-top: 15px;
    }

    nav button {
        margin-left: 0;
        margin-right: 10px;
    }

    .data-buttons {
        flex-direction: column;
    }
}
