* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; padding: 20px; color: #333; }
.container { max-width: 500px; margin: 0 auto; background: white; border-radius: 20px; box-shadow: 0 20px 40px rgba(0,0,0,0.1); overflow: hidden; }
.header { background: linear-gradient(45deg, #ff6b6b, #ee5a24); padding: 30px 20px; text-align: center; color: white; }
.header h1 { font-size: 24px; margin-bottom: 10px; }
.header p { opacity: 0.9; font-size: 14px; }

/* Home page styles */
.home-content { padding: 20px 30px; }
.home-content .intro { font-size: 16px; line-height: 1.6; text-align: center; margin-bottom: 30px; color: #555; }
.home-content .card { background: #f8f9fa; border-radius: 15px; padding: 25px; margin-bottom: 20px; border-left: 5px solid #667eea; }
.home-content .card h2 { margin-top: 0; margin-bottom: 15px; color: #333; }
.home-content .card p { margin-bottom: 20px; line-height: 1.5; color: #666; }
.home-content .card .btn-primary { width: 100%; text-align: center; padding: 15px; font-size: 16px; }
.home-content .card-secondary { border-left-color: #fdcb6e; }
.home-content .card-secondary ul { list-style: none; padding-left: 0; color: #666; }
.home-content .card-secondary ul li { margin-bottom: 8px; padding-left: 20px; position: relative; }
.home-content .card-secondary ul li::before { content: '✓'; color: #2ecc71; position: absolute; left: 0; font-weight: bold; }

/* General UI components */
.mode-selection { display: flex; gap: 15px; padding: 20px; flex-wrap: wrap; justify-content: center; }
.mode-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 15px 10px; border: none; border-radius: 12px; color: white; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; text-align: center; min-width: 180px; }
.mode-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }
.mode-btn__title { margin-bottom: 5px; }
.mode-btn__subtitle { font-size: 12px; font-weight: 400; opacity: 0.8; }
#mode-complete-btn { background: linear-gradient(45deg, #2ed573, #1dd1a1); }
#mode-live-btn { background: linear-gradient(45deg, #54a0ff, #2e86de); }
#edition-zone { padding: 0 20px 20px 20px; border-top: 1px solid #f0f0f0; display: none; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 600; color: #555; }
input[type="datetime-local"], textarea#notes { width: 100%; padding: 12px 16px; border: 2px solid #e1e8ed; border-radius: 12px; font-size: 16px; transition: all 0.3s ease; background: #f8f9fa; }
input[type="datetime-local"]:focus, textarea#notes:focus { outline: none; border-color: #667eea; background: white; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); }
textarea#notes { min-height: 80px; resize: vertical; }
.options-group { margin-top: 20px; padding: 15px; background: #f8f9fa; border-radius: 12px; }
.interruption-item { display: flex; align-items: center; margin-bottom: 10px; }
.interruption-item input { flex: 1; margin-right: 10px; }
.checkbox-group { display: flex; align-items: center; margin-bottom: 15px; }
.checkbox-group label { margin: 0 0 0 10px; font-weight: normal; color: #333; }
#notes-wrapper { display: none; margin-top: 10px; }
.btn { background: linear-gradient(45deg, #667eea, #764ba2); color: white; border: none; padding: 12px 20px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; text-transform: uppercase; letter-spacing: 0.5px; text-decoration: none; display: inline-block; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3); }
.btn-danger { background: linear-gradient(45deg, #ff6b6b, #ee5a24); }
.btn-small { padding: 8px 12px; font-size: 12px; }
.btn-add { width: 100%; margin-top: 20px; padding: 15px; font-size: 16px; }

/* Timeline styles */
.timeline-section { padding: 20px; }
.timeline-day { margin-bottom: 30px; padding-bottom: 25px; }
.day-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.day-date { font-weight: 700; color: #333; font-size: 16px; }
.day-stats { font-size: 12px; color: #666; background: #f0f1f2; padding: 5px 10px; border-radius: 20px; }
.timeline-bar { position: relative; height: 40px; background: #e9ecef; border-radius: 8px; overflow: visible; margin-top: 25px;}
.time-labels { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 10px; color: #666; }
.sleep-block-wrapper { position: absolute; top: 0; height: 100%; z-index: 5; }
.sleep-block { position: relative; width: 100%; height: 100%; cursor: pointer; transition: all 0.3s ease; border-radius: 4px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sleep-block:hover { filter: brightness(1.2); }
.sleep-block--in-progress { background: linear-gradient(to right, #ffaf40, #ff793f); border-radius: 4px 0 0 4px; z-index: 10; }
.sleep-block--in-progress::after { content: ''; position: absolute; right: -20px; top: 0; width: 0; height: 0; border-top: 20px solid transparent; border-bottom: 20px solid transparent; border-left: 20px solid #ff793f; }
.sleep-block-duration { color: white; font-size: 12px; font-weight: 600; text-shadow: 1px 1px 2px rgba(0,0,0,0.7); }
.sleep-block-duration-outside {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 6; /* Must be on top of the sleep-block */
    pointer-events: none; /* Allows clicks to go through to the block underneath */
}
.interruption-mark { color: #ffdd59; font-weight: bold; font-size: 20px; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); line-height: 1; transform: translateX(-50%); }
.sleep-block-forced-wakeup::after { content: ''; position: absolute; right: 0; top: 0; width: 5px; height: 100%; background-color: #d63031; border-radius: 0 4px 4px 0; }
.sleep-block-notes-wrapper { position: absolute; bottom: -22px; left: 0; width: 100%; text-align: center; }
.sleep-block-notes-underline { height: 3px; background-color: #ffdd59; border-radius: 2px; width: 100%; margin: 0 auto; }
.sleep-block-notes-text { font-size: 11px; color: #4a4a4a; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }

/* New Sleep Block Colors */
.sleep-block--nap { background: linear-gradient(45deg, #a8e6cf, #dcedc1); }
.sleep-block--night-long { background: linear-gradient(45deg, #1d3557, #2c3e50); } /* Darkest */
.sleep-block--night-avg { background: linear-gradient(45deg, #2c3e50, #34495e); } /* Medium */
.sleep-block--night-short { background: linear-gradient(45deg, #457b9d, #5e8b9e); } /* Lightest */

/* Details Panel */
.sleep-details { background: white; margin-top: 15px; padding: 20px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border-left: 4px solid #667eea; display: none; animation: slideDown 0.3s ease-out; }
.sleep-details.show { display: block; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.details-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #f0f0f0; }
.details-header h3 { color: #333; margin: 0; font-size: 18px; }
.close-details { color: #999; font-size: 24px; font-weight: bold; cursor: pointer; line-height: 1; padding: 5px; border-radius: 50%; transition: all 0.3s ease; }
.detail-item { margin-bottom: 15px; padding: 12px; background: #f8f9fa; border-radius: 10px; }
.detail-label { font-weight: 600; color: #555; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }
.detail-value { font-size: 16px; color: #333; }
.action-buttons { display: flex; gap: 10px; margin-top: 15px; justify-content: flex-end; }
.loading { text-align: center; padding: 20px; color: #666; }
.error { background: #ffe6e6; color: #d63031; padding: 15px; border-radius: 10px; margin: 20px; border: 1px solid #fab1a0; }
.average-section { padding: 15px; background: #f8f9fa; border-radius: 12px; border-top: 2px solid #e9ecef; margin: 20px 0; text-align: center; }
.average-section div { font-size: 14px; color: #333; line-height: 1.5; }

/* Live Tracker */
#live-tracker-view { text-align: center; padding: 20px; }
#live-chronometer { font-size: 28px; font-weight: 700; color: #333; margin: 10px 0 20px 0; }
#live-interruption-form { margin-top: 20px; padding-top: 20px; border-top: 1px solid #e9ecef; }
.chronometer-blinking { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Diaper Tracker Styles */
.quantity-selector { display: flex; gap: 20px; align-items: center; font-size: 24px; }
.quantity-selector label { cursor: pointer; display: flex; align-items: center; gap: 5px; }
.quantity-selector input[type="radio"] { width: 20px; height: 20px; }
.diaper-events-list { display: flex; flex-direction: column; gap: 10px; }
.diaper-event-item { display: flex; align-items: center; padding: 10px; background: #f8f9fa; border-radius: 8px; cursor: pointer; transition: background-color 0.2s; }
.diaper-event-item:hover { background-color: #e9ecef; }
.diaper-event-item .event-time { font-weight: 600; color: #333; margin-right: 15px; }
.diaper-event-item .event-icon { font-size: 20px; }

/* Premium Combined View Styles */
.filter-toggles { display: flex; gap: 20px; justify-content: center; padding: 10px 0 20px 0; border-bottom: 1px solid #e9ecef; margin-bottom: 20px; }
.filter-toggles label { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.diaper-events-track { position: absolute; top: -20px; left: 0; width: 100%; height: 20px; }
.diaper-event-marker { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 18px; cursor: pointer; transition: transform 0.2s ease; z-index: 6; }
.diaper-event-marker:hover { transform: translateX(-50%) scale(1.4); }
.diaper-event-marker.poo-size-2 { font-size: 22px; }
.diaper-event-marker.poo-size-3 { font-size: 26px; }

/* Registration Overlay */
.registration-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.registration-box { background: white; padding: 30px 40px; border-radius: 15px; max-width: 400px; width: 90%; text-align: center; }
.registration-box h2 { margin-top: 0; margin-bottom: 15px; }
.registration-box p { color: #666; margin-bottom: 25px; }
.registration-box input { width: 100%; padding: 12px; font-size: 16px; border: 2px solid #ddd; border-radius: 8px; margin-bottom: 20px; }
.registration-box .btn { width: 100%; }
.error-message { color: #d63031; margin-top: 15px; font-weight: bold; }
.guest-mode .mode-selection, .guest-mode .timeline-section, .guest-mode #edition-zone { display: none; }