* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #f5f5f5;
}

h1 {
    text-align: center;
    color: #333;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-secondary {
    background: #2196F3;
    color: white;
}

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

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

button:hover {
    opacity: 0.9;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section label {
    margin-right: 15px;
}

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

.entry {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.entry-info {
    flex: 1;
}

.entry-datetime {
    font-weight: bold;
    color: #333;
}

.entry-type {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
}

.type-diaper { background: #FFF3E0; color: #E65100; }
.type-feeding { background: #E3F2FD; color: #1565C0; }
.type-pumping { background: #F3E5F5; color: #7B1FA2; }
.type-temperature { background: #FFEBEE; color: #C62828; }
.type-sleep { background: #E8EAF6; color: #3949AB; }
.type-wakeup { background: #FFF8E1; color: #F57F17; }
.type-nap { background: #E0F2F1; color: #00695C; }
.type-bad { background: #E1F5FE; color: #0277BD; }
.type-hapje { background: #F1F8E9; color: #33691E; }

.entry-details {
    color: #666;
    margin-top: 5px;
}

.entry-comment {
    color: #888;
    font-style: italic;
    margin-top: 3px;
    font-size: 13px;
}

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

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

.modal.active {
    display: flex;
}

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

.modal-content h2 {
    margin-top: 0;
}

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.checkbox-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

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

.type-specific {
    display: none;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
    margin-top: 10px;
}

.type-specific.active {
    display: block;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.file-input {
    display: none;
}

/* Day Header */
.day-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    cursor: pointer;
    user-select: none;
}

.day-header:first-child {
    margin-top: 0;
}

.day-header-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.day-header.collapsed .day-header-title {
    margin-bottom: 10px;
}

.day-header.collapsed .day-stats {
    display: flex;
}

.day-toggle {
    font-size: 12px;
    opacity: 0.8;
}

.day-entries {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.day-entries.collapsed {
    display: none;
}

.day-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: rgba(255,255,255,0.2);
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
}

.stat-label {
    font-size: 11px;
    opacity: 0.9;
}

/* Sync status */
.sync-status {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sync-status.synced {
    background: #E8F5E9;
    color: #2E7D32;
}

.sync-status.syncing {
    background: #FFF3E0;
    color: #E65100;
}

.sync-status.error {
    background: #FFEBEE;
    color: #C62828;
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.sync-status.syncing .sync-dot {
    animation: pulse 1s infinite;
}

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

/* Login modal */
.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.login-modal.active {
    display: flex;
}

.login-box {
    background: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 350px;
    text-align: center;
}

.login-box h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

.login-box input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    margin-bottom: 15px;
}

.login-box button {
    width: 100%;
}

.login-error {
    color: #C62828;
    margin-bottom: 15px;
    display: none;
}

.login-error.visible {
    display: block;
}

.app-content {
    display: none;
}

.app-content.visible {
    display: block;
}

.header-loading-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    margin: 0 4px;
    vertical-align: middle;
    animation: pulse 1s infinite;
}

.stat-loading-text {
    opacity: 0.7;
    font-size: 13px;
}

.day-loading-indicator {
    padding: 15px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.day-empty {
    text-align: center;
    color: #666;
    padding: 10px;
    margin: 0;
}
