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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    position: relative;
}

.sync-btn {
    position: absolute;
    right: 0;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sync-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.sync-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.sync-icon {
    font-size: 1.2em;
    transition: transform 0.5s ease;
}

.sync-btn.syncing .sync-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

h1 {
    color: #333;
    font-size: 2.5em;
    font-weight: 600;
}

/* Test Mode Banner - Clear but Not Obnoxious */
.test-mode-banner {
    background: #ff9800;
    color: white;
    text-align: center;
    padding: 12px 20px;
    margin: 20px -30px;
    font-weight: bold;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-left: 5px solid #f57c00;
    border-right: 5px solid #f57c00;
}

.test-mode-banner .test-icon {
    font-size: 1.2em;
}

.test-mode-banner .test-text {
    letter-spacing: 1px;
}

/* Test mode - minimal styling, just for banner visibility */

/* Test Mode Modal - Simple and Clear */
.test-mode-modal {
    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: 3000;
}

.test-modal-content {
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    max-width: 450px;
    margin: 20px;
    text-align: center;
    border: 3px solid #ff9800;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.test-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.test-modal-header h2 {
    color: #ff9800;
    font-size: 1.5em;
    margin: 0;
    font-weight: bold;
}

.test-modal-icon {
    font-size: 1.5em;
}

.test-modal-body {
    margin-bottom: 20px;
    color: #333;
    font-size: 1em;
    line-height: 1.4;
}

.test-modal-body p {
    margin-bottom: 8px;
}

.test-modal-button {
    background: #ff9800;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease;
}

.test-modal-button:hover {
    background: #f57c00;
}

.mode-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}

.mode-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn.todo-mode {
    background: white;
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mode-btn.edit-mode {
    background: #5b7fff;
    color: white;
    box-shadow: 0 2px 10px rgba(91, 127, 255, 0.3);
}

.mode-btn.inactive {
    background: #f0f0f0;
    color: #999;
    box-shadow: none;
}

.people-tabs {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.person-tab {
    padding: 10px 20px;
    font-size: 1.3em;
    font-weight: 600;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
    position: relative;
}

.person-tab.active {
    color: #5b7fff;
}

.person-tab.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    right: 0;
    height: 3px;
    background: #5b7fff;
    border-radius: 2px;
}

.tasks-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 15px;
}

.tasks-table th {
    padding: 10px;
    font-size: 1.3em;
    font-weight: 600;
    color: #666;
    text-align: center;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 15px;
}

.tasks-table th:first-child {
    font-size: 1.5em;
    font-weight: 700;
    color: #333;
}

.tasks-table th.child-name-column {
    width: 120px;
    min-width: 120px;
}

.tasks-table th.active {
    color: #5b7fff;
    position: relative;
}

.tasks-table th.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: #5b7fff;
    border-radius: 2px;
}

.tasks-table tr.task-row {
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.tasks-table tr.task-row:hover {
    background: #f0f1f3;
    transform: translateX(5px);
}

.tasks-table td {
    padding: 15px;
    text-align: center;
    border-radius: 12px;
}

.tasks-table td:first-child {
    text-align: left;
    font-size: 1.2em;
    color: #333;
    min-width: 200px;
    border-radius: 12px 0 0 12px;
}

.tasks-table td:last-child {
    border-radius: 0 12px 12px 0;
}

.task-input {
    padding: 8px 15px;
    border: 2px solid #5b7fff;
    border-radius: 20px;
    background: white;
    color: #5b7fff;
    font-size: 1em;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
}

.task-input.na {
    border-color: #999;
    background: #999;
    color: white;
}

.task-checkbox {
    width: 30px;
    height: 30px;
    cursor: pointer;
    transform: scale(2);
}

.btn {
    padding: 6px 15px;
    border: none;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 2px;
}

.btn-edit {
    background: #4caf50;
    color: white;
}

.btn-edit:hover {
    background: #45a049;
    transform: scale(1.05);
}

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

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

.btn-move {
    background: #2196f3;
    color: white;
    font-weight: bold;
    font-size: 1.1em;
    min-width: 28px;
}

.btn-move:hover:not(:disabled) {
    background: #1976d2;
    transform: scale(1.05);
}

.btn-move:disabled {
    background: #ccc;
    color: #999;
    cursor: not-allowed;
    transform: none;
}

.reset-button-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.reset-btn {
    padding: 12px 30px;
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(255, 107, 53, 0.3);
}

.reset-btn:hover {
    background: #e55a2b;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.add-task-form {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding: 20px;
    background: #f0f7ff;
    border-radius: 12px;
    border: 2px dashed #5b7fff;
}

.add-task-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #5b7fff;
    border-radius: 8px;
    font-size: 1em;
}

.add-task-btn {
    padding: 10px 30px;
    background: #5b7fff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-task-btn:hover {
    background: #4a6ee0;
    transform: scale(1.05);
}

.emoji-picker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    padding: 60px 60px 120px 60px;
    z-index: 1000;
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 20px;
    overflow-y: auto;
    box-sizing: border-box;
}

.emoji-picker-header {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.emoji-close-btn {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
    transition: all 0.2s ease;
}

.emoji-close-btn:hover {
    background: #da190b;
    transform: scale(1.1);
}

.emoji-option {
    background: none;
    border: none;
    font-size: 2.2em;
    cursor: pointer;
    padding: 12px;
    border-radius: 10px;
    transition: all 0.2s;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-option:hover {
    background-color: #f0f0f0;
}

.emoji-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
}


.message-area {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #fff9c4 0%, #ffe4e1 100%);
    border-radius: 15px;
    border: 2px solid #ffd700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 1.1em;
    font-weight: 600;
    color: #8b4513;
}

.message-textarea {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 2px solid #ffd700;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1em;
    line-height: 1.5;
    resize: vertical;
    background: rgba(255, 255, 255, 0.8);
    outline: none;
    transition: border-color 0.3s ease;
}

.message-textarea:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.message-display {
    padding: 15px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    font-size: 1em;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    min-height: 60px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.message-display:empty::before {
    content: "No message today ✨";
    color: #999;
    font-style: italic;
}

/* Celebration Animation Styles */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.celebration-overlay.active {
    opacity: 1;
}

.celebration-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 100%);
    color: white;
    padding: 30px 40px;
    border-radius: 25px;
    font-size: 1.8em;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: celebration-bounce 1s ease-out;
}

@keyframes celebration-bounce {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.celebration-emoji {
    position: absolute;
    font-size: 3em;
    animation: celebration-emoji-float 2s ease-out;
    pointer-events: none;
}

@keyframes celebration-emoji-float {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    20% {
        transform: scale(1.5) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(360deg) translateY(-100px);
        opacity: 0;
    }
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: firework-explosion 1.5s ease-out;
}

@keyframes firework-explosion {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    20% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

.firework:nth-child(1) { background: #ff6b6b; }
.firework:nth-child(2) { background: #4ecdc4; }
.firework:nth-child(3) { background: #45b7d1; }
.firework:nth-child(4) { background: #ffd93d; }
.firework:nth-child(5) { background: #6c5ce7; }
.firework:nth-child(6) { background: #a29bfe; }
.firework:nth-child(7) { background: #fd79a8; }
.firework:nth-child(8) { background: #00b894; }

/* Mobile responsive adjustments for celebration */
@media (max-width: 480px) {
    .celebration-message {
        font-size: 1.4em;
        padding: 20px 30px;
    }

    .celebration-emoji {
        font-size: 2.5em;
    }
}

.message-history {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    border-radius: 15px;
    border: 2px solid #5b7fff;
    box-shadow: 0 4px 15px rgba(91, 127, 255, 0.1);
}

.message-history-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
    color: #5b7fff;
}

.history-count {
    background: #5b7fff;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    margin-left: auto;
}

.message-history-list {
    max-height: 300px;
    overflow-y: auto;
    border-radius: 10px;
}

.sample-message {
    opacity: 0.85;
    border-style: dashed !important;
}

.sample-message .history-date {
    color: #999;
    font-style: italic;
}

.history-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(91, 127, 255, 0.2);
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 12px 15px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: #5b7fff;
    transform: translateX(3px);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    color: #666;
}

.history-date {
    font-weight: 500;
}

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

.history-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-btn-load {
    background: #4caf50;
    color: white;
}

.history-btn-load:hover {
    background: #45a049;
    transform: scale(1.05);
}

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

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

.history-message {
    color: #333;
    line-height: 1.4;
    font-size: 0.95em;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.hidden {
    display: none;
}

/* Setup Wizard Styles */
.setup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.setup-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.setup-wizard {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.setup-wizard h2 {
    color: #5b7fff;
    font-size: 2em;
    margin-bottom: 20px;
}

.setup-wizard p {
    color: #666;
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 30px;
}

.children-setup {
    margin-bottom: 30px;
}

.child-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.child-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.1em;
    transition: border-color 0.3s ease;
}

.child-input:focus {
    outline: none;
    border-color: #5b7fff;
}

.child-input.error {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.05);
}

.remove-child-btn {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.2s ease;
}

.remove-child-btn:hover {
    background: #da190b;
    transform: scale(1.1);
}

.add-child-btn {
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.add-child-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

.setup-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.setup-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.setup-btn-primary {
    background: #5b7fff;
    color: white;
    box-shadow: 0 4px 15px rgba(91, 127, 255, 0.3);
}

.setup-btn-primary:hover {
    background: #4a6ee0;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(91, 127, 255, 0.4);
}

.setup-btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.setup-btn-secondary:hover {
    background: #e0e0e0;
}

.setup-error {
    color: #f44336;
    font-size: 0.9em;
    margin-top: 10px;
    margin-bottom: 10px;
}

.name-short {
    display: none;
}

/* Mobile responsive design for iPhone portrait */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
        border-radius: 15px;
    }

    h1 {
        font-size: 1.8em;
    }

    .header {
        gap: 10px;
    }

    .sync-btn {
        width: 40px;
        height: 40px;
    }

    .sync-icon {
        font-size: 1em;
    }

    .mode-buttons {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 20px;
    }

    .mode-btn {
        padding: 10px 20px;
        font-size: 1em;
    }

    .tasks-table th {
        padding: 5px 2px;
        font-size: 0.9em;
        padding-bottom: 10px;
    }

    .tasks-table th.child-name-column {
        width: 60px;
        min-width: 60px;
    }

    .tasks-table th:first-child {
        font-size: 1.1em;
        font-weight: 700;
    }

    .name-full {
        display: none;
    }

    .name-short {
        display: inline;
    }


    .tasks-table td {
        padding: 8px 2px;
        font-size: 0.9em;
    }

    .tasks-table td:first-child {
        font-size: 1em;
        min-width: auto;
        padding-left: 5px;
    }

    .task-checkbox {
        width: 20px;
        height: 20px;
        transform: scale(1.5);
    }

    .task-input {
        padding: 4px 8px;
        font-size: 0.8em;
    }

    .btn {
        padding: 4px 8px;
        font-size: 0.7em;
        margin: 1px;
    }

    .btn-move {
        min-width: 20px;
        font-size: 0.8em;
    }

    .add-task-form {
        padding: 15px;
        gap: 8px;
    }

    .add-task-input {
        padding: 8px 12px;
        font-size: 0.9em;
    }

    .add-task-btn {
        padding: 8px 20px;
        font-size: 0.9em;
    }

    .message-area {
        margin-top: 20px;
        padding: 15px;
    }

    .message-textarea {
        min-height: 80px;
        font-size: 0.9em;
    }

    .emoji-picker {
        padding: 40px 20px 80px 20px;
        grid-template-columns: repeat(8, 1fr);
        gap: 15px;
    }

    .emoji-option {
        font-size: 1.5em;
        width: 40px;
        height: 40px;
    }

    .message-history {
        margin-top: 15px;
        padding: 12px;
    }

    .message-history-header {
        font-size: 1em;
        margin-bottom: 12px;
    }

    .history-count {
        font-size: 0.7em;
        padding: 1px 6px;
    }

    .message-history-list {
        max-height: 200px;
    }

    .history-item {
        padding: 10px 12px;
        margin-bottom: 8px;
    }

    .history-item-header {
        font-size: 0.8em;
    }

    .history-btn {
        padding: 3px 6px;
        font-size: 0.7em;
    }

    .history-message {
        font-size: 0.85em;
        max-height: 45px;
        -webkit-line-clamp: 2;
    }
}