﻿/* recipe-kroger-store.css - Kroger Store Selection Modal Styles */

.kroger-store-selector {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    width: 90%;
    max-width: 420px;
    max-height: 80vh;
    display: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.store-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
}

    .store-selector-header h4 {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
        color: #333;
    }

.store-selector-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

    .store-selector-close:hover {
        background: #e9ecef;
        color: #333;
    }

.store-selector-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: calc(80vh - 60px);
}

.location-input-group {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

    .location-input-group input {
        flex: 1;
        padding: 8px 12px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 14px;
        min-width: 0;
    }

        .location-input-group input:focus {
            outline: none;
            border-color: #007bff;
            box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
        }

    .location-input-group button {
        padding: 8px 12px;
        background: #007bff;
        color: white;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-size: 14px;
        font-weight: 500;
        transition: background-color 0.15s;
        white-space: nowrap;
    }

        .location-input-group button:hover {
            background: #0056b3;
        }

        .location-input-group button:active {
            background: #004085;
        }

#use-location-btn {
    padding: 8px 10px;
    min-width: 36px;
}

.store-results-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.store-results {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    max-height: 80%;
}

    .store-results::-webkit-scrollbar {
        width: 6px;
    }

    .store-results::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }

    .store-results::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 3px;
    }

        .store-results::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8;
        }

.store-item {
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: white;
}

    .store-item:last-child {
        margin-bottom: 0;
    }

    .store-item:hover {
        background: #f8f9fa;
        border-color: #007bff;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .store-item.selected {
        background: #e7f3ff;
        border-color: #007bff;
        box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
    }

.store-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #212529;
    line-height: 1.2;
}

.store-address {
    color: #6c757d;
    font-size: 13px;
    margin-bottom: 4px;
    line-height: 1.3;
}

.store-distance {
    color: #28a745;
    font-size: 12px;
    font-weight: 500;
}

.loading-message, .no-results {
    text-align: center;
    color: #6c757d;
    padding: 20px;
    font-style: italic;
    font-size: 14px;
}

.no-results {
    color: #dc3545;
}

.kroger-indicator {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
    vertical-align: middle;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    display: none;
    backdrop-filter: blur(2px);
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .kroger-store-selector {
        width: 95%;
        max-height: 85vh;
    }

    .location-input-group {
        padding: 12px;
    }

        .location-input-group button {
            padding: 8px 10px;
            font-size: 13px;
        }

    .store-results {
        padding: 8px;
    }

    .store-item {
        padding: 10px;
    }

    .store-name {
        font-size: 13px;
    }

    .store-address {
        font-size: 12px;
    }
}

/* Tablet adjustments */
@media (max-width: 768px) and (min-width: 481px) {
    .kroger-store-selector {
        width: 85%;
    }

    .store-results {
        max-height: 250px;
    }
}

/* Animation for modal appearance */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.kroger-store-selector.show {
    animation: modalSlideIn 0.2s ease-out;
}

/* Add these styles to your recipe-kroger-store.css file */

/* Kroger ingredient display styling */
.ingredient-display.kroger-ingredient {
    background-color: #e8f5e8;
    
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 4px;
}

.ingredient-display.kroger-ingredient .ingredient-display__item {
    color: #155724;
    font-weight: 500;
}

.ingredient-display.kroger-ingredient .ingredient-display__price {
    color: #28a745;
    font-weight: 600;
}

.ingredient-display.kroger-ingredient .ingredient-display__description {
    color: #6c757d;
    font-size: 0.9em;
}

/* Distinguish from local ingredients */
.ingredient-display:not(.kroger-ingredient) {
    background-color: #e7f3ff;
    border-left: 3px solid #007bff;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 4px;
}

.ingredient-display:not(.kroger-ingredient) .ingredient-display__item {
    color: #004085;
    font-weight: 500;
}

.ingredient-display:not(.kroger-ingredient) .ingredient-display__price {
    color: #007bff;
    font-weight: 600;
}

/* Animation for when display becomes active */
.ingredient-display.ingredient-display--active {
    animation: displaySlideIn 0.3s ease-out;
}

@keyframes displaySlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Kroger conversion modal - must be above everything */
.kroger-conversion-modal,
#conversion-modal,
.conversion-progress-overlay {
    position: fixed !important;
    z-index: 10000 !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: white !important;
    padding: 2rem !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
    min-width: 400px !important;
}

/* Modal backdrop */
.kroger-conversion-backdrop,
.modal-backdrop {
    position: fixed !important;
    z-index: 9999 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.5) !important;
}

/* Loading message at bottom */
.conversion-status-message {
    position: fixed !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 10001 !important;
    background: #333 !important;
    color: white !important;
    padding: 1rem 2rem !important;
    border-radius: 4px !important;
}