/**
 * Family Calendar - Extended Features Styles
 * Meal Planning, Recipes, Chores, and Rewards
 */

/* Ensure modals appear on top */
#fc-meal-plan-modal,
#fc-recipe-modal,
#fc-recipes-list-modal,
#fc-plan-meal-modal,
#fc-chore-chart-modal,
#fc-chore-modal,
#fc-rewards-modal,
#fc-add-reward-modal {
    z-index: 10001 !important;
}

#fc-recipe-modal,
#fc-chore-modal,
#fc-add-reward-modal,
#fc-plan-meal-modal {
    z-index: 10002 !important; /* Higher for nested modals */
}

/* ========================================
   MEAL PLAN & RECIPES STYLES
   ======================================== */

/* Meal Plan Toolbar */
.fc-meal-plan-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* Meal Week Grid */
.fc-meal-week-grid {
    background: white;
    border-radius: var(--fc-border-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px var(--fc-shadow);
}

.fc-meal-grid-header {
    display: grid;
    grid-template-columns: 120px repeat(7, 1fr);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.fc-meal-grid-corner {
    padding: 16px;
    font-weight: 600;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.fc-meal-grid-day-header {
    padding: 16px;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.fc-meal-day-name {
    font-weight: 600;
    font-size: 1.1em;
}

.fc-meal-day-date {
    font-size: 0.9em;
    opacity: 0.8;
    margin-top: 4px;
}

.fc-meal-grid-row {
    display: grid;
    grid-template-columns: 120px repeat(7, 1fr);
    border-bottom: 1px solid var(--fc-border);
}

.fc-meal-type-label {
    padding: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    border-right: 1px solid var(--fc-border);
}

.fc-meal-cell {
    padding: 12px;
    min-height: 100px;
    border-right: 1px solid var(--fc-border);
    position: relative;
}

.fc-meal-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.fc-add-meal-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px dashed #E0E0E0;
    background: transparent;
    color: #757575;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
}

.fc-add-meal-btn:hover {
    background: #FF1744;
    color: white;
    border-color: #FF1744;
    transform: scale(1.1);
}

.fc-meal-item {
    background: #FFFFFF;
    padding: 8px;
    border-radius: 8px;
    border-left: 4px solid #FF1744;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fc-meal-recipe-title {
    font-weight: 600;
    font-size: 0.95em;
    margin-bottom: 4px;
}

.fc-meal-chef {
    font-size: 0.85em;
    font-weight: 500;
}

.fc-meal-notes {
    font-size: 0.8em;
    color: #757575;
    margin-top: 4px;
}

.fc-delete-meal-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.fc-delete-meal-btn:hover {
    opacity: 1;
}

/* Recipes List Modal */
.fc-recipes-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    align-items: center;
}

.fc-recipes-toolbar .fc-input {
    flex: 1;
    max-width: 400px;
}

.fc-recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.fc-recipe-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: transform 0.2s;
}

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

.fc-recipe-card-header {
    padding: 16px;
    background: linear-gradient(135deg, #FF1744, #FF6D00);
    color: white;
}

.fc-recipe-card-header h4 {
    margin: 0 0 8px 0;
}

.fc-recipe-category {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 0.85em;
    text-transform: capitalize;
}

.fc-recipe-card-body {
    padding: 16px;
}

.fc-recipe-description {
    color: #757575;
    font-size: 0.9em;
    margin-bottom: 12px;
}

.fc-recipe-meta {
    display: flex;
    gap: 16px;
    font-size: 0.9em;
    color: #757575;
}

.fc-recipe-card-footer {
    padding: 12px 16px;
    border-top: 1px solid #E0E0E0;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.fc-meal-time-display {
    padding: 12px;
    background: #FAFAFA;
    border-radius: 8px;
    text-align: center;
}

/* ========================================
   CHORE CHART & REWARDS STYLES
   ======================================== */

/* Chore Toolbar */
.fc-chore-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    align-items: center;
    flex-wrap: wrap;
}

.fc-chore-filter {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

.fc-chore-filter label {
    font-weight: 600;
}

/* Points Summary */
.fc-points-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.fc-points-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 16px;
    border-left: 4px solid #FF1744;
}

.fc-points-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.fc-points-info h4 {
    margin: 0 0 8px 0;
    font-size: 1.1em;
}

.fc-points-total {
    font-size: 1.3em;
    font-weight: bold;
    color: #FF6D00;
}

/* Chores List */
.fc-chores-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fc-chore-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: grid;
    grid-template-columns: 50px 1fr auto;
    gap: 16px;
    align-items: center;
    transition: transform 0.2s;
}

.fc-chore-item:hover {
    transform: translateX(4px);
}

.fc-chore-completed {
    opacity: 0.6;
}

.fc-chore-completed .fc-chore-title {
    text-decoration: line-through;
}

.fc-chore-checkbox {
    width: 50px;
    height: 50px;
    border: 3px solid #FF1744;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #FF1744;
    font-weight: bold;
}

.fc-chore-content {
    flex: 1;
}

.fc-chore-title {
    font-size: 1.2em;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.fc-chore-description {
    color: #757575;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.fc-chore-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.9em;
}

.fc-chore-assigned {
    font-weight: 600;
}

.fc-chore-frequency {
    padding: 2px 8px;
    background: #FAFAFA;
    border-radius: 4px;
    text-transform: capitalize;
}

.fc-chore-points {
    font-weight: bold;
    color: #FF6D00;
}

.fc-chore-actions {
    display: flex;
    gap: 8px;
    flex-direction: column;
}

/* Rewards */
.fc-rewards-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.fc-rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.fc-reward-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: transform 0.2s;
}

.fc-reward-card:hover {
    transform: translateY(-4px);
}

.fc-reward-redeemed {
    opacity: 0.6;
    position: relative;
}

.fc-reward-redeemed::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0, 0, 0, 0.05) 10px,
        rgba(0, 0, 0, 0.05) 20px
    );
    pointer-events: none;
}

.fc-reward-header {
    padding: 16px;
    background: linear-gradient(135deg, #00E676, #00E5FF);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fc-reward-header h4 {
    margin: 0;
}

.fc-reward-badge {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 0.85em;
}

.fc-reward-body {
    padding: 16px;
}

.fc-reward-member {
    font-weight: 600;
    margin-bottom: 8px;
}

.fc-reward-points {
    font-size: 1.3em;
    font-weight: bold;
    color: #FF6D00;
    margin-bottom: 12px;
}

.fc-reward-progress {
    margin-top: 12px;
}

.fc-progress-bar {
    height: 8px;
    background: #FAFAFA;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.fc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00E676, #00E5FF);
    transition: width 0.3s;
}

.fc-progress-text {
    font-size: 0.85em;
    color: #757575;
    text-align: center;
}

.fc-reward-footer {
    padding: 12px 16px;
    border-top: 1px solid #E0E0E0;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Form Styles for New Features */
.fc-form-third {
    flex: 1;
    min-width: 150px;
}

/* Empty State */
.fc-empty-state {
    text-align: center;
    padding: 40px;
    color: #757575;
    font-size: 1.1em;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .fc-meal-grid-header,
    .fc-meal-grid-row {
        grid-template-columns: 100px repeat(7, 1fr);
    }

    .fc-meal-type-label,
    .fc-meal-grid-corner {
        font-size: 0.85em;
        padding: 12px 8px;
    }

    .fc-meal-cell {
        min-height: 80px;
        padding: 8px;
    }

    .fc-recipes-grid,
    .fc-rewards-grid {
        grid-template-columns: 1fr;
    }

    .fc-chore-item {
        grid-template-columns: 40px 1fr;
        gap: 12px;
    }

    .fc-chore-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: flex-end;
    }

    .fc-points-summary {
        grid-template-columns: 1fr;
    }
}

/* Touch Enhancements */
.fc-add-meal-btn,
.fc-complete-chore-btn,
.fc-redeem-reward-btn {
    min-height: 56px;
    min-width: 56px;
}

/* Button Size Variants */
.fc-btn-sm {
    padding: 8px 16px;
    font-size: 0.9em;
    min-height: 40px;
}

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

.fc-btn-danger:hover {
    background: #d32f2f;
}

/* Animations */
@keyframes fc-slide-in-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fc-chore-item,
.fc-recipe-card,
.fc-reward-card,
.fc-meal-item {
    animation: fc-slide-in-up 0.3s ease-out;
}
