/* Toast Notifications - matching admin page styling */
.toast {
    position: fixed;
    top: calc(var(--header-height) + 20px); /* Position below header */
    right: 20px;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 15px 20px;
    border-radius: 0.75rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    border-left: 4px solid var(--primary-color);
    z-index: 10001;
    transform: translateX(400px);
    animation: toastSlideIn 0.3s ease forwards;
    max-width: 400px;
    word-wrap: break-word;
    font-weight: 500;
}

.toast.success { 
    border-left-color: var(--success-color); 
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.toast.warning { 
    border-left-color: var(--warning-color); 
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.toast.error { 
    border-left-color: var(--danger-color); 
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.toast.info { 
    border-left-color: var(--primary-color); 
    background: rgba(157, 140, 255, 0.1);
    color: var(--primary-color);
}

@keyframes toastSlideIn {
    to { transform: translateX(0); }
}

@keyframes toastSlideOut {
    to { transform: translateX(400px); }
}

/* Mobile responsive toast positioning */
@media (max-width: 768px) {
    .toast {
        top: 80px !important; /* Slightly lower on mobile */
        left: 10px !important;
        right: 10px !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Goals Page Styles */
.goals-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

/* Page Subtitle */
.goals-subtitle {
    font-size: 1.375rem;
    color: var(--text-primary);
    text-align: center;
    margin: 0;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 0.5rem 0;
}

/* Child Selector */
.child-selector-container {
    margin: 0;
}

.child-tabs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.child-tab {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.child-tab:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.child-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Child Tab Avatar Styles */
.child-tab-avatar {
    position: relative;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.child-tab-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.child-tab-avatar-initials {
    color: white;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.child-tab-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.child-tab-name {
    font-weight: 500;
}

.child-stars {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
}

.child-stars .star-count {
    font-weight: 600;
    font-size: 0.9rem;
}

.child-stars .star-icon {
    width: 14px;
    height: 14px;
}

.child-tab.active .child-stars {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.child-tab:not(.active) .child-stars {
    background: rgba(0, 0, 0, 0.05);
}

/* Stars Summary */
.stars-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 0.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.stars-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 2rem;
    font-weight: 700;
    flex: 1;
}

.star-icon-large {
    width: 48px;
    height: 48px;
    animation: pulse 2s infinite;
}

.stars-count {
    color: var(--primary-color);
    font-size: 3rem;
}

.stars-label {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-secondary);
}

/* Behavior Buttons */
.behavior-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
}

.behavior-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

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

.behavior-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.behavior-btn i {
    font-size: 1rem;
}

.behavior-btn .star-change {
    font-size: 0.85rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.behavior-btn .star-change .star-icon {
    width: 14px;
    height: 14px;
}

.good-behavior {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
}

.good-behavior:hover {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.naughty-behavior {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: white;
}

.naughty-behavior:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Goal Card */
.goal-card {
    background: var(--white);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    max-width: 400px;
    width: 100%;
}

.goal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.goal-card.completed {
    background: var(--white);
    border: 2px solid #4caf50;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.2);
}

.goal-card.completed .goal-title {
    color: #2e7d32;
}

.goal-card.completed .progress-percentage {
    color: #4caf50;
    font-weight: 700;
}

/* Goal Header */
.goal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.goal-image-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.goal-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 0.5rem;
    padding: 0.5rem;
    background: var(--background);
}

.goal-completed-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #4caf50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.goal-info {
    flex: 1;
}

.goal-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.goal-cost {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.goal-cost img {
    width: 20px;
    height: 20px;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 1rem;
}

.progress-bar-wrapper {
    width: 100%;
    height: 24px;
    background: var(--background);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
}

.goal-card.completed .progress-bar {
    background: linear-gradient(90deg, #4caf50 0%, #66bb6a 100%);
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.progress-percentage {
    font-weight: 600;
    color: var(--primary-color);
}

.progress-stars {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.progress-stars .star-icon {
    width: 16px;
    height: 16px;
}

/* Completion Badge */
/* Goal Actions */
.goal-actions {
    margin-top: 1rem;
}

.redeem-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.redeem-btn.enabled {
    background: #4caf50;
    color: white;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.redeem-btn.enabled:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.4);
}

.redeem-btn.enabled:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.redeem-btn.disabled {
    background: #f5f5f5;
    color: #999;
    border: 1px solid #e0e0e0;
    cursor: not-allowed;
}

/* Chores Section */
.chores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.chore-card {
    background: var(--white);
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.chore-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.chore-card.completing {
    transform: scale(0.95);
    opacity: 0.7;
}

.chore-image-container {
    margin-bottom: 0.75rem;
}

.chore-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.chore-info {
    margin-bottom: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chore-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.chore-stars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
}

.chore-stars .star-icon {
    width: 16px;
    height: 16px;
}

.complete-chore-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}

.complete-chore-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.complete-chore-btn:active {
    transform: translateY(0);
}

.empty-chores-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.empty-chores-state .empty-state-icon {
    font-size: 2.5rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.empty-state h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .stars-summary {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
    
    .behavior-buttons {
        flex-direction: row;
        gap: 0.5rem;
        width: 100%;
    }
    
    .behavior-btn {
        flex: 1;
        justify-content: center;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .behavior-btn span:first-of-type {
        display: none; /* Hide text labels on mobile to save space */
    }
    
    .goals-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .chores-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .chore-card {
        padding: 0.75rem;
    }
    
    .chore-image {
        width: 50px;
        height: 50px;
    }
    
    .chore-title {
        font-size: 0.8rem;
    }
    
    .complete-chore-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .stars-display {
        font-size: 1.5rem;
    }
    
    .stars-count {
        font-size: 2.5rem;
    }
    
    .goal-image {
        width: 60px;
        height: 60px;
    }
    
    .goal-title {
        font-size: 1.125rem;
    }
}