/* Global Location Styles for LamaAgri */

/* Location Button Styles */
.location-btn {
    background: linear-gradient(135deg, #7faf51, #8bc34a) !important;
    color: white !important;
    padding: 6px 12px !important;
    border-radius: 16px !important;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    box-shadow: 0 2px 6px rgba(127, 175, 81, 0.3);
    line-height: 1;
    height: 28px;
    min-height: 28px;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 1000;
    margin: 0;
    white-space: nowrap;
    width: auto !important;
    justify-content: center;
}

/* Location button positioning in top bar */
.top-bar.right {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.top-bar.right .location-container {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.top-bar.right .location-btn {
    align-self: center;
    height: 28px;
    line-height: 1;
    vertical-align: middle;
    margin: 0;
}

.location-btn:hover {
    background: linear-gradient(135deg, #6b9a47, #7cb342) !important;
    color: white !important;
    text-decoration: none;
    border: none;
    box-shadow: 0 4px 12px rgba(127, 175, 81, 0.4);
    transform: translateY(-1px);
}

.location-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(127, 175, 81, 0.3);
}

.location-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
    text-decoration: none;
    border: none;
    box-shadow: none;
}

.location-btn i {
    font-size: 12px;
    color: white;
}

/* Pulsing animation for location button when no location is set */
.location-btn:not(.location-set) {
    animation: pulse-location 2s infinite;
}

@keyframes pulse-location {
    0% {
        box-shadow: 0 2px 8px rgba(127, 175, 81, 0.3);
    }
    50% {
        box-shadow: 0 2px 8px rgba(127, 175, 81, 0.6);
    }
    100% {
        box-shadow: 0 2px 8px rgba(127, 175, 81, 0.3);
    }
}

.location-btn.location-set {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    color: white !important;
    border: none;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.location-btn.location-set:hover {
    background: linear-gradient(135deg, #218838, #1ea085) !important;
    color: white !important;
    border: none;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    transform: translateY(-1px);
}

.location-btn.location-set:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.location-btn.location-set i {
    color: white;
    font-size: 12px;
}

/* Location Modal Styles */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.modal-header {
    background: linear-gradient(135deg, #7faf51, #8bc34a);
    color: white;
    border-radius: 15px 15px 0 0;
    border: none;
}

.modal-header .close {
    color: white;
    opacity: 0.8;
}

.modal-header .close:hover {
    opacity: 1;
}

.modal-title i {
    margin-right: 8px;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 20px 25px;
}

.btn-success {
    background: linear-gradient(135deg, #7faf51, #8bc34a);
    border: none;
    border-radius: 8px;
    padding: 10px 25px;
    font-weight: 600;
}

.btn-success:hover {
    background: linear-gradient(135deg, #6b9a47, #7cb342);
    transform: translateY(-1px);
}

/* Location Notification Styles */
#location-notification {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-left: 4px solid #7faf51;
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#location-notification .btn-sm {
    padding: 5px 15px;
    font-size: 12px;
    border-radius: 15px;
}

#location-notification .btn-success {
    background: linear-gradient(135deg, #7faf51, #8bc34a);
    border: none;
}

#location-notification .btn-secondary {
    background: #6c757d;
    border: none;
}

/* Location-based Product Filtering */
.location-filter {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #7faf51;
}

.location-filter .filter-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.location-filter .distance-slider {
    width: 100%;
    margin: 10px 0;
}

.location-filter .distance-value {
    font-weight: 600;
    color: #7faf51;
}

/* Distance Badge */
.distance-badge {
    background: linear-gradient(135deg, #7faf51, #8bc34a);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    margin-left: 8px;
}



/* Location Status Indicator */
.location-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.location-status.active {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.location-status.inactive {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Location-based Search Enhancement */
.search-with-location {
    position: relative;
}

.search-with-location .location-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #7faf51;
    font-size: 16px;
}

/* Location Button Tooltip */
.location-btn::before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
    margin-bottom: 5px;
}

.location-btn::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
    margin-bottom: 1px;
}

.location-btn:hover::before,
.location-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Ensure entire button area is clickable */
.location-btn,
.location-btn * {
    pointer-events: auto !important;
    cursor: pointer !important;
}

.location-btn span,
.location-btn i {
    pointer-events: none !important;
    user-select: none;
}

/* Location container styling */
.location-container {
    position: relative;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* Location button standalone styling */
.location-btn {
    position: relative;
    z-index: 1001;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .top-bar.right {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .top-bar.right .location-container {
        margin-left: 0;
        order: 3;
    }
    
    .location-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .location-btn span {
        display: none;
    }
    
    .location-btn::before {
        display: none;
    }
    
    .location-btn::after {
        display: none;
    }
    
    #location-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .location-filter {
        padding: 10px;
    }
    
    .distance-badge {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    /* Mobile Navigation Buttons */
    .mobile-location-btn,
    .mobile-buy-sell-btns {
        display: flex !important;
        align-items: center;
        gap: 6px;
        margin-right: 10px;
    }
    
    .mobile-location-btn .location-btn,
    .mobile-buy-sell-btns .buy-btn-mobile,
    .mobile-buy-sell-btns .sell-btn-mobile {
        background: linear-gradient(135deg, #7faf51, #8bc34a);
        color: white;
        padding: 6px 10px;
        border-radius: 18px;
        text-decoration: none;
        font-size: 11px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 4px;
        white-space: nowrap;
        transition: all 0.3s ease;
    }
    
    .mobile-buy-sell-btns .buy-btn-mobile {
        background: linear-gradient(135deg, #2196f3, #03a9f4);
    }
    
    .mobile-buy-sell-btns .sell-btn-mobile {
        background: linear-gradient(135deg, #ff6b35, #f7931e);
    }
    
    .mobile-location-btn .location-btn:hover,
    .mobile-buy-sell-btns .buy-btn-mobile:hover,
    .mobile-buy-sell-btns .sell-btn-mobile:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
    
    .mobile-location-btn .location-btn i,
    .mobile-buy-sell-btns .buy-btn-mobile i,
    .mobile-buy-sell-btns .sell-btn-mobile i {
        font-size: 11px;
        color: white;
    }
    
    /* Hide desktop location button on mobile */
    .top-bar.right .location-container {
        display: none !important;
    }
    
    /* Ensure mobile buttons are visible in header middle */
    .header-middle .biolife-cart-info {
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }
    
    /* Fix logo override issue on mobile */
    @media (max-width: 767px) {
        .header-middle .biolife-logo {
            max-width: 140px !important;
            overflow: visible;
            position: relative;
            z-index: 30 !important;
        }
        
        .header-middle .biolife-logo img {
            max-width: 100% !important;
            height: auto !important;
            position: relative;
            z-index: 30 !important;
        }
        
        .mobile-buy-sell-btns {
            z-index: 20 !important;
            position: relative;
            margin-left: 40px;
        }
        
        .header-middle .row {
            align-items: center;
            position: relative;
        }
        
        .header-middle .col-xs-6:first-child {
            flex: 0 0 auto;
            max-width: 180px;
            position: relative;
            z-index: 30 !important;
        }
        
        .header-middle .col-xs-6:last-child {
            flex: 1;
            display: flex;
            justify-content: flex-end;
            position: relative;
            z-index: 20 !important;
        }
        
        /* Ensure proper spacing between logo and buttons */
        .header-middle .col-xs-6:first-child + .col-xs-6 {
            margin-left: 30px;
        }
        
        /* Prevent logo from being clipped */
        .header-middle .biolife-logo {
            display: block;
            width: auto;
            height: auto;
            padding-right: 10px;
        }
        
        /* Ensure buttons don't overlap logo */
        .mobile-buy-sell-btns {
            min-width: auto;
            flex-shrink: 0;
            position: absolute;
            right: 60px;
        }
        
        /* Force proper stacking order */
        .header-middle .col-xs-6:first-child {
            overflow: visible !important;
        }
        
        /* Ensure hamburger menu stays on the right */
        .mobile-menu-toggle {
            position: absolute;
            right: 15px;
        }
    }
}

/* Location Loading States */
.location-loading {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #7faf51;
}

.location-loading .spinner {
    width: 12px;
    height: 12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #7faf51;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Location Error States */
.location-error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    padding: 10px;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
    margin: 10px 0;
}

.location-error i {
    margin-right: 5px;
}

/* Location Success States */
.location-success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    padding: 10px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    margin: 10px 0;
}

.location-success i {
    margin-right: 5px;
} 