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

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 30px;
}

h2, h3 {
    color: #34495e;
    margin-bottom: 15px;
}

.patient-info {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

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

input[type="text"],
input[type="date"],
input[type="number"],
textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.calendar-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.month-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

.nav-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
}

.nav-btn:hover {
    background: #2980b9;
}

#currentMonth {
    font-size: 20px;
    font-weight: bold;
    min-width: 200px;
    text-align: center;
}

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

.calendar-header,
.calendar-day {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    min-height: 60px;
}

.calendar-header {
    background: #ecf0f1;
    font-weight: bold;
}

.calendar-day {
    background: white;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s;
}

.calendar-day:hover {
    background: #e8f4f8;
}

.calendar-day.has-headache {
    background: #ffebee;
}

.calendar-day.selected {
    border: 2px solid #3498db;
}

.day-number {
    font-weight: bold;
    margin-bottom: 5px;
}

.day-indicator {
    font-size: 10px;
    color: #e74c3c;
}

.legend {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pdf-settings {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.toggle-label input[type="checkbox"] {
    margin-right: 10px;
    width: auto;
    cursor: pointer;
}

.toggle-label span {
    font-size: 14px;
    color: #555;
}

.actions {
    text-align: center;
    margin-top: 30px;
}

.btn-primary,
.btn-secondary {
    padding: 12px 30px;
    margin: 0 10px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary {
    background: #27ae60;
    color: white;
}

.btn-primary:hover {
    background: #229954;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    width: auto;
}

input[type="range"] {
    width: 70%;
    margin-right: 10px;
}

#intensityValue {
    font-weight: bold;
    color: #e74c3c;
}

.medication-list {
    margin-bottom: 10px;
}

.medication-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 5px;
    background: #f8f9fa;
    border-radius: 4px;
}

.medication-item input[type="checkbox"] {
    margin-right: 10px;
}

.medication-form {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.medication-form h4 {
    margin-top: 0;
}

.medication-list-container {
    max-height: 300px;
    overflow-y: auto;
}

#medicationSearch, #dayMedicationSearch {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    background: #f9f9f9;
}

#medicationSearch:focus, #dayMedicationSearch:focus {
    outline: none;
    border-color: #2196f3;
    background: white;
}

#medicationSearch::placeholder, #dayMedicationSearch::placeholder {
    color: #999;
}

.med-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 5px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.med-item button {
    margin-left: 10px;
    padding: 5px 10px;
    font-size: 12px;
}

.med-delete {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

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

.multi-select-info {
    background: #e3f2fd;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
}

.multi-select-info p {
    margin: 0;
}

.multi-select-info button {
    margin-left: 10px;
}

.calendar-day.multi-selected {
    background: #bbdefb;
    border-color: #2196f3;
}

.footer {
    margin-top: 50px;
    padding: 30px 20px;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.privacy-info {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #888;
    font-size: 14px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-links a {
    color: #2196f3;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-links .separator {
    color: #ccc;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .month-selector {
        gap: 10px;
    }
    
    #currentMonth {
        font-size: 16px;
        min-width: 150px;
    }
    
    .nav-btn {
        padding: 6px 12px;
        font-size: 16px;
    }
    
    .calendar-grid {
        gap: 3px;
        grid-template-columns: repeat(7, 1fr);
    }
    
    .calendar-header {
        padding: 5px 2px;
        font-size: 12px;
        min-height: 30px;
    }
    
    .calendar-day {
        min-height: 45px;
        padding: 4px;
        font-size: 12px;
    }
    
    .day-number {
        font-size: 14px;
    }
    
    .day-indicator {
        font-size: 9px;
    }
    
    .actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }
    
    .btn-primary,
    .btn-secondary {
        margin: 0;
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 15px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .patient-info,
    .calendar-section,
    .legend,
    .pdf-settings {
        padding: 15px;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 20px;
    }
    
    .calendar-grid {
        gap: 2px;
    }
    
    .calendar-header {
        font-size: 10px;
        padding: 4px 1px;
    }
    
    .calendar-day {
        min-height: 40px;
        padding: 3px;
        font-size: 11px;
    }
    
    .day-number {
        font-size: 12px;
    }
    
    .day-indicator {
        font-size: 8px;
    }
    
    input[type="text"],
    input[type="date"],
    input[type="number"],
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .modal-content {
        width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .close {
        font-size: 24px;
        padding: 5px;
    }
}