/* Enhanced Diet Profile Styles */

/* Diet Modal Specific Styles */
#diet-plan-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

#diet-plan-modal.show {
    display: flex !important;
}

.diet-modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
    z-index: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close:hover {
    color: #000;
    background: #f0f0f0;
}

.enhanced-diet-setup {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 10px;
}

.diet-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.diet-section:last-child {
    border-bottom: none;
}

.diet-section h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.section-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Diet Style Cards */
.diet-styles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.diet-style-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    position: relative;
    display: block;
}

.diet-style-card:hover {
    border-color: #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
    transform: translateY(-2px);
}

.diet-style-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    top: 10px;
    right: 10px;
}

.diet-style-card input[type="radio"]:checked + .diet-card-content {
    border-left: 4px solid #4CAF50;
    background: linear-gradient(135deg, #f8fff8 0%, #e8f5e8 100%);
}

.diet-card-content {
    padding: 5px;
    transition: all 0.3s ease;
}

.diet-card-content h5 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.diet-card-content p {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.diet-card-content .macros {
    font-size: 11px;
    color: #4CAF50;
    font-weight: 500;
    background: #f0f8f0;
    padding: 4px 8px;
    border-radius: 20px;
    display: inline-block;
}

/* Meal Timing */
.meal-timing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.timing-checkbox {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.timing-checkbox:hover {
    background: #f9f9f9;
    border-color: #4CAF50;
}

.timing-checkbox input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.timing-checkbox input[type="checkbox"]:checked + span {
    color: #4CAF50;
    font-weight: 500;
}

/* Macro Nutrients */
.macro-section {
    margin-bottom: 25px;
}

.macro-section h5 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

.macro-boxes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.macro-box {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: white;
    position: relative;
}

.macro-box:hover {
    border-color: #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
    transform: translateY(-2px);
}

.macro-box.selected {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #f8fff8 0%, #e8f5e8 100%);
}

.macro-box.selected::after {
    content: "✓";
    position: absolute;
    top: 5px;
    right: 8px;
    color: #4CAF50;
    font-weight: bold;
    font-size: 16px;
}

.macro-box .food-name {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.macro-box .nutrition-info {
    display: block;
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* Nutrition Goals */
.nutrition-goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.goal-input {
    display: flex;
    flex-direction: column;
}

.goal-input label {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 14px;
}

.goal-input input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.goal-input input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

/* Submit Section */
.diet-submit-section {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.save-diet-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.save-diet-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.save-diet-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.submit-note {
    margin: 10px 0 0 0;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Selected Foods Summary */
.selected-foods-summary {
    background: #f8fff8;
    border: 1px solid #e0f0e0;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    display: none;
}

.selected-foods-summary h6 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-weight: 600;
}

.selected-foods-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.selected-food-tag {
    background: #4CAF50;
    color: white;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

/* Eating Window Info */
.eating-window-info {
    background: #f0f8f0;
    border: 1px solid #4caf50;
    border-radius: 6px;
    padding: 10px;
    margin: 10px 0;
    font-size: 12px;
    color: #2e7d32;
}

/* Diet Recommendation Banner */
.diet-recommendation-banner {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 1px solid #90caf9;
    border-radius: 8px;
    padding: 12px;
    margin: 15px 0;
    font-size: 13px;
    color: #1565c0;
    position: relative;
}

/* Diet Profile Display */
.diet-profile-summary {
    background: linear-gradient(135deg, #f8fff8 0%, #e8f5e8 100%);
    border: 1px solid #4CAF50;
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
}

.diet-style-display h4 {
    margin: 0 0 10px 0;
    color: #2e7d32;
    font-size: 18px;
}

.diet-style-display p {
    margin: 0 0 15px 0;
    color: #4a5568;
    font-size: 14px;
}

.diet-goals-display {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.macro-goal {
    background: white;
    border: 1px solid #4CAF50;
    color: #2e7d32;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.edit-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .diet-modal-content {
        padding: 20px;
        margin: 10px;
        max-height: 95vh;
    }
    
    .diet-styles-grid {
        grid-template-columns: 1fr;
    }
    
    .macro-boxes-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    
    .nutrition-goals-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .meal-timing-grid {
        grid-template-columns: 1fr;
    }
    
    .close {
        top: 10px;
        right: 15px;
        font-size: 24px;
    }
}

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

.diet-style-card input[type="radio"]:checked + .diet-card-content {
    animation: dietCardSelect 0.3s ease;
}

.macro-box.selecting {
    animation: dietCardSelect 0.3s ease;
}

/* Scrollbar styling for modal */
.enhanced-diet-setup::-webkit-scrollbar {
    width: 6px;
}

.enhanced-diet-setup::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.enhanced-diet-setup::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 3px;
}

.enhanced-diet-setup::-webkit-scrollbar-thumb:hover {
    background: #45a049;
}
