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

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

.header {
    text-align: center;
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
}

.header h1 {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.settings-icon {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.3s;
    z-index: 100;
}

.settings-icon:hover {
    transform: rotate(45deg);
}

/* Mobile responsive: Move settings to top right corner */
@media (max-width: 600px) {
    .header {
        position: relative;
        padding-right: 60px; /* Make room for settings icon */
    }
    
    .settings-icon {
        position: fixed;
        right: 15px;
        top: 15px;
        font-size: 1.8rem;
        background: white;
        border-radius: 50%;
        width: 45px;
        height: 45px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
}

.user-select {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
}

.user-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.user-btn.child {
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: white;
}

.user-btn.parent {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
}

.user-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.user-btn.active {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.main-content {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: none;
}

.main-content.active {
    display: block;
}

.task-form {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

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

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

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

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-success {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
}

.btn-danger {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
}

.btn-warning {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.tasks-list {
    display: grid;
    gap: 15px;
}

.task-card {
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 20px;
    background: #fff;
    transition: all 0.3s;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.task-card.pending {
    border-left: 5px solid #ffa500;
}

.task-card.completed {
    border-left: 5px solid #28a745;
}

.task-card.rejected {
    border-left: 5px solid #dc3545;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.task-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    max-height: 3.9em; /* ~3 lines */
    overflow: hidden;
    line-height: 1.3;
    transition: max-height 0.3s ease;
    word-wrap: break-word;
    flex: 1;
    margin-right: 10px;
}

.task-title.expanded {
    max-height: none;
}

.task-title:hover {
    color: #667eea;
}

.task-reward {
    background: #28a745;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
}

.task-status {
    margin: 10px 0;
    font-weight: bold;
}

.status-pending { color: #ffa500; }
.status-completed { color: #28a745; }
.status-rejected { color: #dc3545; }

.photo-section {
    margin: 15px 0;
}

.photo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 10px 0;
}

.photo-container {
    text-align: center;
}

.photo-container img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 10px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.2s;
}

.photo-container img:hover {
    border-color: #667eea;
}

.photo-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    cursor: pointer;
}

.photo-zoom-overlay.active {
    display: flex;
}

.photo-zoom-image {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    object-fit: contain;
}

.camera-btn {
    width: 100%;
    height: 150px;
    border: 2px dashed #ddd;
    background: #f8f9fa;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.camera-btn:hover {
    border-color: #667eea;
    background: #e3f2fd;
}

.camera-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.hidden {
    display: none;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.stat-card .amount {
    font-size: 2.5rem;
    font-weight: bold;
}

.child-selector {
    margin: 15px 0;
    padding: 15px;
    background: #e3f2fd;
    border-radius: 10px;
}

.child-selector h4 {
    margin-bottom: 10px;
    color: #333;
}

.child-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.child-btn {
    padding: 8px 16px;
    border: 2px solid #667eea;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.child-btn.selected {
    background: #667eea;
    color: white;
}

.child-btn:hover {
    transform: translateY(-1px);
}

.task-meta {
    margin: 10px 0;
    font-size: 0.9rem;
    color: #666;
}

.admin-panel {
    margin-bottom: 30px;
    padding: 20px;
    background: #fff3cd;
    border-radius: 10px;
    border-left: 5px solid #f39c12;
}

.admin-panel h3 {
    color: #856404;
    margin-bottom: 15px;
}

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

/* Settings Panel Styles */
.settings-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.3);
    transition: right 0.3s ease-in-out;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.settings-panel.open {
    right: 0;
}

.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 999;
}

.settings-overlay.open {
    opacity: 1;
    visibility: visible;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.settings-header h2 {
    color: #667eea;
}

.close-settings {
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.close-settings:hover {
    color: #000;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.child-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.child-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.child-item-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.child-item input {
    flex: 1;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 5px;
}

.child-item button.delete-btn {
    padding: 8px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.child-customization {
    display: flex;
    gap: 10px;
    align-items: center;
}

.emoji-selector {
    position: relative;
}

.emoji-display {
    font-size: 2rem;
    cursor: pointer;
    padding: 5px 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: white;
    transition: all 0.3s;
}

.emoji-display:hover {
    border-color: #667eea;
    transform: scale(1.1);
}

.emoji-picker {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    display: none;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    max-height: 200px;
    overflow-y: auto;
}

.emoji-picker.open {
    display: grid;
}

.emoji-option {
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    text-align: center;
    border-radius: 5px;
    transition: all 0.2s;
}

.emoji-option:hover {
    background: #e3f2fd;
    transform: scale(1.2);
}

.color-selector {
    position: relative;
}

.color-display {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #ddd;
    transition: all 0.3s;
}

.color-display:hover {
    border-color: #333;
    transform: scale(1.1);
}

.color-donut-picker {
    position: fixed;
    display: none;
    pointer-events: none;
    z-index: 1000;
}

.color-donut-picker.active {
    display: block;
    pointer-events: all;
}

.color-donut-center {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    border: 3px solid #ddd;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.color-donut-option {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.2s;
    top: 50%;
    left: 50%;
}

.color-donut-option:hover {
    transform: scale(1.3);
    z-index: 10;
    border-width: 4px;
}

.color-slider-container {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    display: none;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    width: 250px;
}

.color-slider-container.open {
    display: block;
}

.color-slider-group {
    margin-bottom: 10px;
}

.color-slider-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    font-weight: bold;
}

.color-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
}

.color-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.color-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

#hue-slider {
    background: linear-gradient(to right, 
        hsl(0, 100%, 50%), 
        hsl(60, 100%, 50%), 
        hsl(120, 100%, 50%), 
        hsl(180, 100%, 50%), 
        hsl(240, 100%, 50%), 
        hsl(300, 100%, 50%), 
        hsl(360, 100%, 50%)
    );
}

#saturation-slider {
    background: linear-gradient(to right, hsl(0, 0%, 50%), hsl(0, 100%, 50%));
}

#lightness-slider {
    background: linear-gradient(to right, hsl(0, 0%, 0%), hsl(0, 0%, 50%), hsl(0, 0%, 100%));
}

.color-preview {
    width: 100%;
    height: 40px;
    border-radius: 5px;
    margin-top: 10px;
    border: 2px solid #ddd;
}

.add-child-btn {
    width: 100%;
    margin-top: 10px;
}

@media (max-width: 600px) {
    .settings-panel {
        width: 100%;
        right: -100%;
    }
    
    .user-select {
        flex-direction: column;
        align-items: center;
    }
    
    .photo-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .child-buttons {
        justify-content: center;
    }
}
