/* Main CSS file for index.html (Dashboard) */
@import url('variables.css');
@import url('language-toggle.css');

/* ===== HISTORY PAGE STYLES ===== */
.nav-link {
    color: var(--text-color);
    text-decoration: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-sm);
    transition: var(--transition-default);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.nav-link:hover {
    background: var(--card-background);
    color: var(--primary-color);
}

.nav-link.active {
    background: var(--primary-light);
    color: var(--text-color);
    font-weight: bold;
}

.history-container {
    background: var(--card-background);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-default);
}

.filter-btn {
    background: var(--card-background-light);
    color: var(--text-color);
    border: 1px solid var(--primary-light);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-default);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
}

.filters-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.child-filter {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.child-filter label {
    color: var(--text-color);
    font-weight: 600;
    font-size: 1rem;
}

.child-filter select {
    padding: var(--spacing-sm);
    border: 2px solid var(--primary-light);
    border-radius: var(--border-radius-sm);
    background: var(--card-background);
    color: var(--text-color);
    font-size: 1rem;
    transition: var(--transition-default);
    max-width: 250px;
}

.child-filter select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(157, 140, 255, 0.2);
}

.filter-buttons {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.history-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    border-radius: var(--border-radius-sm);
    background: var(--card-background-light);
    gap: var(--spacing-md);
}

.history-item.chore, .history-item.nice {
    border-left: 4px solid var(--chore-color);
}

.history-item.reward {
    border-left: 4px solid var(--reward-color);
}

.history-item.naughty {
    border-left: 4px solid #ff3333;
}

.history-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-content {
    flex: 1;
}

.history-title {
    font-weight: bold;
    margin-bottom: var(--spacing-xs);
}

.history-child-name {
    color: var(--primary-color);
    font-size: var(--font-sm);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.history-details {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: var(--font-xs);
}

.history-stars {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-weight: bold;
}

.history-stars.added {
    color: var(--chore-color);
}

.history-stars.spent {
    color: var(--reward-color);
}

.history-stars.naughty {
    color: #ff3333;
}

.history-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
    text-align: center;
}

.history-empty-state .history-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: .5;
}

/* ===== FEEDBACK PAGE STYLES ===== */
.feedback-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* Feedback header with three sections layout */
.feedback-container header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: var(--border-radius-md);
    padding: 25px 30px;
    margin-bottom: 30px;
    color: white;
    box-shadow: var(--shadow-default);
}

.feedback-container .header-content {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    gap: 20px;
}

.feedback-container .header-title h1 {
    color: white;
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    text-align: left;
}

.feedback-container .header-description {
    text-align: center;
}

.feedback-container .header-description p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 400;
}

.feedback-container .header-actions {
    display: flex;
    justify-content: flex-end;
}

/* History page header with three sections layout */
.container header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: var(--border-radius-md);
    padding: 25px 30px;
    margin-bottom: 30px;
    color: white;
    box-shadow: var(--shadow-default);
}

.container .header-content {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    gap: 20px;
}

.container .header-title h1 {
    color: white;
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    text-align: left;
}

.container .header-description {
    text-align: center;
}

.container .header-description p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 400;
}

/* Special styling for star counter in header description */
.container .header-description .star-counter {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    padding: 12px 24px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    animation: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.container .header-description .star-counter .count-value {
    position: static;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-shadow: none;
    z-index: auto;
}

.container .header-description .star-counter .star-badge {
    position: static;
    width: 24px;
    height: 24px;
    z-index: auto;
}

.container .header-actions {
    display: flex;
    justify-content: flex-end;
}

.feedback-section {
    background: var(--card-background);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-default);
    margin-top: var(--spacing-lg);
}

.feedback-section h2 {
    color: var(--primary-color);
    font-size: var(--font-xl);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.feedback-type-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.feedback-card {
    background: var(--card-background);
    border: 2px solid var(--primary-light);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.feedback-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(157, 140, 255, 0.2);
}

.feedback-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.feedback-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.feedback-card i {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.feedback-card.selected i {
    color: white;
}

.feedback-card h3 {
    font-size: var(--font-md);
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.feedback-card.selected h3 {
    color: white;
}

.feedback-card p {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin: 0;
    transition: color 0.3s ease;
}

.feedback-card.selected p {
    color: rgba(255, 255, 255, 0.9);
}

/* Responsive adjustments for feedback cards */
@media (max-width: 768px) {
    .feedback-type-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .feedback-card {
        min-height: 120px;
        padding: var(--spacing-md);
    }
    
    .feedback-card i {
        font-size: 1.5rem;
    }
    
    .feedback-card h3 {
        font-size: var(--font-sm);
    }
    
    .feedback-card p {
        font-size: 0.8rem;
    }
    
    /* Main dashboard improvements for tablet */
    .container {
        padding: 15px;
    }
    
    .title-area h1 {
        font-size: 1.8rem;
    }
    
    .star-counter {
        padding: 10px 15px;
    }
    
    .star-counter .count-value {
        font-size: 1.5rem;
    }
    
    .star-badge {
        width: 20px;
        height: 20px;
    }
    
    /* Three-section header mobile responsive */
    .container .header-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 15px;
    }
    
    .container .header-title h1 {
        text-align: center;
        font-size: 1.5rem;
    }
    
    .container .header-actions {
        justify-content: center;
    }
    
    .container .header-description .star-counter {
        font-size: 1.2rem;
        padding: 8px 16px;
    }
    
    .chores-grid,
    .rewards-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }
    
    .chore-item,
    .reward-item {
        padding: 15px;
    }
    
    .chore-item img,
    .reward-item img {
        width: 40px;
        height: 40px;
    }
    
    .chore-item h3,
    .reward-item h3 {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .feedback-type-cards {
        grid-template-columns: 1fr;
    }
    
    /* Mobile dashboard improvements */
    .container {
        padding: 10px;
    }
    
    .title-area {
        text-align: center;
        margin-bottom: 20px;
    }
    
    .title-area h1 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    
    .star-counter {
        padding: 8px 12px;
        display: inline-flex;
    }
    
    .star-counter .count-value {
        font-size: 1.2rem;
    }
    
    .star-badge {
        width: 18px;
        height: 18px;
    }
    
    .child-tabs {
        overflow-x: auto;
        padding-bottom: 10px;
        margin-bottom: 20px;
    }
    
    .child-tab {
        min-width: 100px;
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .chores-grid,
    .rewards-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .chore-item,
    .reward-item {
        padding: 12px;
        text-align: center;
    }
    
    .chore-item img,
    .reward-item img {
        width: 35px;
        height: 35px;
    }
    
    .chore-item h3,
    .reward-item h3 {
        font-size: 0.8rem;
        margin: 8px 0 4px;
    }
    
    .chore-item .star-value,
    .reward-item .star-cost {
        font-size: 0.7rem;
    }
    
    /* Control buttons mobile optimization */
    .control-buttons {
        margin: 20px 0;
        text-align: center;
    }
    
    .control-buttons button {
        padding: 10px 15px;
        font-size: 0.9rem;
        margin: 5px;
    }
    
    /* Section headers mobile */
    .section h2 {
        font-size: 1.2rem;
        text-align: center;
        margin-bottom: 15px;
    }
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, var(--background-color) 0%, var(--background-end) 100%);
    color: var(--text-color);
    min-height: 100vh;
}

/* Main Content Layout Override for index.html */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
    transition: var(--transition-default);
    padding: var(--spacing-lg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    background: var(--card-background);
    border-radius: 20px;
    box-shadow: var(--shadow-default);
    position: relative;
}

button {
    cursor: pointer;
    border: 0;
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font: bold var(--font-xs) 'Nunito', sans-serif;
    transition: var(--transition-default);
}

button:hover {
    opacity: .9;
    transform: scale(1.05);
}

/* ===== HEADER STYLES ===== */
header {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-lg) var(--spacing-xl);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    margin-bottom: var(--spacing-xl);
    position: relative;
    overflow: visible;
    color: white;
    text-align: center;
}

header h1 {
    color: white;
    margin: 0;
    font-size: var(--font-xl);
}

.title-area {
    display: flex;
    align-items: center;
    position: relative;
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    margin-bottom: var(--spacing-lg);
    display: flex;
    justify-content: center;
}

.star-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    position: relative;
    z-index: 5;
}

/* ===== STAR COUNTER ===== */
.star-counter {
    position: relative;
    width: 100px;
    height: 100px;
    margin-left: var(--spacing-md);
    animation: float 3s ease-in-out infinite;
    z-index: 10;
    filter: drop-shadow(0 0 15px rgba(255,215,0, .7));
    display: flex;
    align-items: center;
    justify-content: center;
}

.star-counter .star-bg,
.star-badge {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

.star-counter .count-value {
    position: relative;
    font-size: 2rem;
    font-weight: bold;
    color: blueviolet;
    text-shadow: none;
    z-index: 6;
}

.star-counter .star-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 0 5px rgba(255,255,255,.8));
    animation: star-spin 10s linear infinite;
}

/* ===== STAR CONTROLS BUTTONS ===== */
.add-star, .remove-star {
    padding: var(--spacing-xs) var(--spacing-lg);
    font-size: var(--font-sm);
    border-radius: var(--border-radius-lg);
    min-width: 140px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 3px 0 rgba(0,0,0,0.2);
    transition: all .2s ease;
    position: relative;
    overflow: hidden;
}

.add-star {
    background: var(--success-color);
    color: white;
}

.add-star i {
    margin-right: 8px;
    font-size: 1.1em;
}

.remove-star {
    background: var(--warning-color);
    color: white;
}

.remove-star i {
    margin-right: 8px;
    font-size: 1.1em;
}

.add-star:hover, .remove-star:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0,0,0,0.2);
}

.add-star:active, .remove-star:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.2);
}

/* ===== MAIN CONTENT AREA ===== */
main {
    margin-top: var(--spacing-lg);
}

/* ===== CHORES GRID ===== */
.chores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    width: 100%;
    justify-content: center;
    padding: var(--spacing-md) 0;
}

.chore-card {
    background: var(--card-background);
    border-radius: 20px;
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-xs);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    width: 210px;
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    border: 2px solid transparent;
}

.chore-card.completed {
    animation: pulse 1s;
    box-shadow: 0 0 15px var(--primary-color);
}

.chore-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-light);
}

.chore-title {
    font-size: var(--font-sm);
    margin-bottom: var(--spacing-xs);
    color: var(--text-secondary);
    text-align: center;
    flex-shrink: 0;
    line-height: 1.2;
}

.chore-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0;
    height: 130px;
}

.chore-image {
    width: 130px;
    height: 125px;
    object-fit: contain;
    margin-bottom: -5px;
    transition: transform .3s ease;
}

.star-value {
    font-weight: bold;
    color: var(--star-color);
    margin-bottom: 0;
    font-size: var(--font-sm);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: var(--spacing-xs) 0;
    width: 100%;
}

.star-value img.star-icon {
    width: 24px;
    height: 24px;
    margin: 0 2px;
}

/* ===== REWARDS SECTION ===== */
.rewards-section {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 3px dashed var(--primary-light);
}

.rewards-section h2 {
    color: var(--primary-color);
    font-size: var(--font-xl);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    width: 100%;
    margin-bottom: var(--spacing-xl);
}

.reward-card {
    background: var(--secondary-light);
    border-radius: 20px;
    padding: var(--spacing-md);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    width: 210px;
    height: 220px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
}

.reward-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-light);
}

.reward-title {
    font-size: var(--font-md);
    margin-bottom: var(--spacing-xs);
    color: var(--text-color);
    font-weight: 600;
    height: auto;
    min-height: 20px;
}

.reward-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    margin-bottom: var(--spacing-sm);
}

.reward-image {
    max-width: 65px;
    max-height: 90px;
    object-fit: contain;
    transition: transform .3s ease;
}

.cost-value {
    font-weight: bold;
    color: #2c5282;
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.cost-value .star-icon {
    width: 24px;
    height: 24px;
    margin-left: 2px;
}

.redeem-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 15px;
    width: 100%;
    margin-top: var(--spacing-sm);
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.redeem-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(157, 140, 255, 0.3);
}

.redeem-btn:disabled {
    background: var(--disabled-color);
    cursor: not-allowed;
    opacity: .7;
}

/* ===== CHILD SELECTION ===== */
.child-selection {
    margin-bottom: var(--spacing-xl);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.child-tabs {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

.child-tab {
    background: var(--card-background);
    border: 2px solid var(--primary-light);
    border-radius: var(--border-radius-md);
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 120px;
    justify-content: center;
}

.child-tab:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.child-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-color: var(--primary-color);
}

.child-tab img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.child-tab-avatar {
    width: 30px;
    height: 30px;
    position: relative;
}

.child-tab-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.child-tab-avatar-initials {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.child-tab-name {
    font-weight: 600;
}

.child-tab-stars {
    display: flex;
    align-items: center;
    gap: 4px;
}

.child-tab-stars .star-icon {
    width: 16px;
    height: 16px;
    border-radius: 0;
}

.add-child-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: 2px dashed var(--primary-light);
    border-radius: 50%;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition-default);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.add-child-btn:hover {
    background: var(--primary-light);
    border-style: solid;
    transform: scale(1.1);
}

/* ===== ANIMATIONS ===== */
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,165,0, .7); }
    70% { box-shadow: 0 0 0 15px rgba(255,165,0, 0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes star-spin {
    to { transform: rotate(360deg); }
}

/* ===== ENHANCED STAR FEEDBACK ANIMATIONS ===== */
@keyframes starBurst {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

@keyframes starEarn {
    0% {
        transform: scale(1);
        filter: brightness(1) drop-shadow(0 0 5px rgba(255,215,0, 0.5));
    }
    50% {
        transform: scale(1.3);
        filter: brightness(1.5) drop-shadow(0 0 20px rgba(255,215,0, 1));
    }
    100% {
        transform: scale(1);
        filter: brightness(1) drop-shadow(0 0 5px rgba(255,215,0, 0.5));
    }
}

@keyframes starSpend {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(0.7);
        filter: brightness(0.5);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(720deg);
        opacity: 0;
    }
}

@keyframes milestoneReached {
    0% {
        transform: scale(1);
        background: var(--card-background);
    }
    25% {
        transform: scale(1.05);
        background: linear-gradient(45deg, #ffeb3b, #ff9800);
    }
    50% {
        transform: scale(1.1);
        background: linear-gradient(45deg, #ff9800, #ffeb3b);
    }
    75% {
        transform: scale(1.05);
        background: linear-gradient(45deg, #ffeb3b, #ff9800);
    }
    100% {
        transform: scale(1);
        background: var(--card-background);
    }
}

@keyframes choreComplete {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0.3);
        background: linear-gradient(135deg, #66bb6a, #4caf50);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 20px rgba(76, 175, 80, 0);
        background: var(--card-background);
    }
}

@keyframes rewardRedeem {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 159, 48, 0.7);
    }
    25% {
        transform: scale(1.05);
        box-shadow: 0 0 0 5px rgba(255, 159, 48, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(255, 159, 48, 0.3);
        background: linear-gradient(135deg, #ff9800, #ffb74d);
    }
    75% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(255, 159, 48, 0.1);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 20px rgba(255, 159, 48, 0);
        background: var(--secondary-light);
    }
}

@keyframes redeemed-flash {
    0%, 100% { box-shadow: 0 0 0 2px var(--secondary-color); }
    50% { box-shadow: 0 0 0 10px rgba(255,140,0, .5); }
}

@keyframes toastSlideIn {
    to { transform: translateX(0); }
}

@keyframes toastSlideOut {
    to { transform: translateX(400px); }
}

/* ===== ANIMATION CLASSES ===== */

/* Enhanced star counter animations */
.star-counter.earning {
    animation: starEarn 0.6s ease-in-out;
}

.star-counter.spending {
    animation: starSpend 0.6s ease-in-out;
}

.star-counter.milestone {
    animation: milestoneReached 1.5s ease-in-out;
}

/* Enhanced chore completion feedback */
.chore-card.completing {
    animation: choreComplete 0.8s ease;
    transform-origin: center;
}

/* Enhanced reward redemption feedback */
.reward-card.redeeming {
    animation: rewardRedeem 1s ease;
}

.reward-card.redeemed {
    animation: redeemed-flash 1s ease;
    background: var(--secondary-lighter);
}

/* Star burst particles */
.star-burst {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #ffeb3b 0%, #ff9800 50%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    animation: starBurst 0.8s ease-out forwards;
}

.star-burst:nth-child(odd) {
    background: radial-gradient(circle, #ff9800 0%, #ffeb3b 50%, transparent 70%);
}

/* Confetti particles */
.confetti-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #ffeb3b;
    pointer-events: none;
    z-index: 1000;
    animation: confetti 2s ease-out forwards;
}

.confetti-particle:nth-child(2n) { background: #ff9800; }
.confetti-particle:nth-child(3n) { background: #4caf50; }
.confetti-particle:nth-child(4n) { background: #2196f3; }
.confetti-particle:nth-child(5n) { background: #e91e63; }

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-background);
    color: var(--text-color);
    padding: 15px 20px;
    border-radius: var(--border-radius-md);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    border-left: 4px solid var(--primary-color);
    z-index: 10000;
    transform: translateX(400px);
    animation: toastSlideIn 0.3s ease forwards;
}

.toast.success { border-left-color: var(--success-color); }
.toast.warning { border-left-color: var(--warning-color); }
.toast.info { border-left-color: var(--primary-color); }

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: var(--spacing-md);
    }
    
    .container {
        padding: var(--spacing-md);
        margin: var(--spacing-sm);
    }
    
    header {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .title-area {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .chores-grid,
    .rewards-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--spacing-md);
    }
    
    .child-selection {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .child-tabs {
        justify-content: center;
    }
    
    .star-controls {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
}

/* ===== MODAL STYLES ===== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-background);
    border-radius: var(--border-radius-md);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid var(--primary-light);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
}

.modal-header h2 {
    margin: 0;
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-form {
    padding: 25px;
}

.modal-form .form-group {
    margin-bottom: 20px;
}

.modal-form .form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 600;
    font-size: 1rem;
}

.modal-form input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--primary-light);
    border-radius: var(--border-radius-sm);
    background: var(--card-background);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.modal-form input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(157, 140, 255, 0.1);
}

.modal-form .avatar-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.modal-form .avatar-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    border: 3px solid var(--primary-light);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--card-background-light);
    position: relative;
}

.modal-form .avatar-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.modal-form .avatar-option.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    box-shadow: 0 0 0 2px var(--primary-color);
}

.modal-form .avatar-option img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.modal-form .avatar-label {
    font-size: 0.8rem;
    color: var(--text-color);
    margin-top: 5px;
    font-weight: 600;
}

.modal-form .avatar-option.active .avatar-label {
    color: white;
}

.modal-form .upload-option {
    background: var(--card-background-light);
    border: 3px dashed var(--primary-light);
}

.modal-form .upload-option:hover {
    border-style: solid;
    background: var(--primary-light);
}

.modal-form .upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.modal-form .upload-placeholder i {
    font-size: 1.5rem;
}

.modal-form .upload-option:hover .upload-placeholder {
    color: white;
}

.upload-preview {
    margin-top: 15px;
    text-align: center;
    position: relative;
}

.upload-preview img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.remove-upload-btn {
    position: absolute;
    top: -5px;
    right: calc(50% - 55px);
    background: var(--danger-color);
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.2s ease;
}

.remove-upload-btn:hover {
    background: var(--danger-dark);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: flex-end;
}

.form-actions .btn {
    padding: 12px 25px;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-actions .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.form-actions .btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.form-actions .btn-secondary {
    background: var(--card-background-light);
    color: var(--text-color);
    border: 2px solid var(--primary-light);
}

.form-actions .btn-secondary:hover {
    background: var(--primary-light);
    color: white;
}

/* Modal Selection Styles */
.selection-section {
    margin-top: 20px;
}

.selection-section h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.selection-counter {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.selection-item {
    background: var(--card-background);
    border: 2px solid var(--primary-light);
    border-radius: var(--border-radius-sm);
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.selection-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.selection-item.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
    color: white;
}

.selection-item.selected::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 8px;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.selection-item-image {
    margin-bottom: 8px;
}

.selection-item-image img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.selection-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-color);
}

.selection-item.selected .selection-item-title {
    color: white;
}

.selection-item-value {
    font-size: 0.8rem;
    color: var(--star-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.selection-item.selected .selection-item-value {
    color: white;
}

.selection-item-value img {
    width: 12px;
    height: 12px;
}

/* Mobile responsiveness for modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal-form {
        padding: 20px;
    }
    
    .modal-form .avatar-selection {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .modal-form .avatar-option {
        width: 80px;
        height: 80px;
    }
    
    .modal-form .avatar-option img {
        width: 50px;
        height: 50px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .selection-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .selection-item {
        padding: 8px;
    }
    
    .selection-item-image img {
        width: 30px;
        height: 30px;
    }
    
    .selection-item-title {
        font-size: 0.8rem;
    }
    
    .selection-item-value {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .modal-form .avatar-selection {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-form .avatar-option {
        width: 70px;
        height: 70px;
    }
    
    .modal-form .avatar-option img {
        width: 45px;
        height: 45px;
    }
    
    .main-content {
        padding: var(--spacing-sm);
    }
    
    .container {
        padding: var(--spacing-sm);
    }
    
    header {
        padding: var(--spacing-md);
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .star-counter {
        width: 80px;
        height: 80px;
    }
    
    .count-value {
        font-size: 1.8rem;
    }
    
    .quick-actions {
        margin-bottom: var(--spacing-md);
    }
    
    .star-controls {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .add-star, .remove-star {
        min-width: 100px;
        height: 36px;
        font-size: var(--font-xs);
    }
    
    .child-selection {
        margin-bottom: var(--spacing-md);
    }
    
    .child-tab {
        min-width: 80px;
        padding: 8px 12px;
        font-size: var(--font-xs);
    }
    
    .add-child-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .chore-card {
        height: 180px;
        width: 100%;
        max-width: 180px;
    }
    
    .reward-card {
        height: 200px;
        padding: 10px;
        width: 100%;
        max-width: 180px;
    }
    
    .chore-image {
        width: 100px;
        height: 95px;
    }
    
    .reward-image {
        max-width: 50px;
        max-height: 70px;
    }
    
    .chores-grid,
    .rewards-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-sm);
        justify-items: center;
    }
    
    .cost-value {
        font-size: var(--font-md);
        margin-bottom: var(--spacing-sm);
    }
    
    .cost-value .star-icon {
        width: 20px;
        height: 20px;
    }
    
    .redeem-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: .9rem;
        height: 40px;
    }
}