
/**
 * Public CSS for Location Based Delivery
 *
 * @package Location_Based_Delivery
 */

/* Popup Overlay */
.lbd-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

/* Popup Content */
.lbd-popup-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 100%;
    animation: lbdFadeInUp 0.3s ease-out;
}

.lbd-map-popup {
    max-width: 800px;
}

@keyframes lbdFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Popup Header */
.lbd-popup-header {
    padding: 30px 30px 20px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
}

.lbd-popup-header h2 {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.lbd-popup-header p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.lbd-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #666;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.lbd-popup-close:hover {
    color: #333;
    background: #f5f5f5;
    transform: rotate(90deg);
}

.lbd-popup-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* Popup Body */
.lbd-popup-body {
    padding: 30px;
}

/* Buttons */
.lbd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
}

.lbd-btn-large {
    width: 100%;
    padding: 16px 24px;
    font-size: 18px;
}

.lbd-btn-primary {
    background: #4CAF50;
    color: white;
}

.lbd-btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.lbd-btn-success {
    background: #4CAF50;
    color: white;
}

.lbd-btn-success:hover {
    background: #45a049;
}

.lbd-btn-success.lbd-btn-disabled {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.lbd-btn-success.lbd-btn-disabled:hover {
    background: #cccccc;
    transform: none;
    box-shadow: none;
}

.lbd-btn-text {
    background: transparent;
    color: #4CAF50;
    border: 1px solid #4CAF50;
    padding: 8px 16px;
    font-size: 14px;
}

.lbd-btn-text:hover {
    background: #f5f5f5;
}

/* Divider */
.lbd-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: #999;
}

.lbd-divider::before,
.lbd-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e0e0e0;
}

.lbd-divider span {
    padding: 0 15px;
    font-size: 14px;
}

/* Login Text */
.lbd-login-text {
    text-align: center;
    margin: 20px 0 0;
    font-size: 14px;
    color: #666;
}

.lbd-login-text a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 600;
}

.lbd-login-text a:hover {
    text-decoration: underline;
}

/* Map Container */
.lbd-map-container {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Service Area Message */
.lbd-service-area-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #856404;
}

.lbd-service-area-message.lbd-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.lbd-service-area-message svg {
    flex-shrink: 0;
}

/* Location Info */
.lbd-location-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 20px;
}

.lbd-location-address h3 {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.lbd-location-address p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Loading Overlay */
.lbd-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lbd-loading-spinner {
    text-align: center;
}

.lbd-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: lbdSpin 1s linear infinite;
}

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

.lbd-loading-spinner p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .lbd-popup-content {
        max-width: 95%;
        margin: 10px;
    }
    
    .lbd-popup-header {
        padding: 20px;
    }
    
    .lbd-popup-body {
        padding: 20px;
    }
    
    .lbd-map-container {
        height: 300px;
    }
    
    .lbd-popup-header h2 {
        font-size: 20px;
    }
    
    .lbd-btn-large {
        font-size: 16px;
        padding: 14px 20px;
    }
    
    .lbd-location-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .lbd-map-container {
        height: 250px;
    }
    
    .lbd-popup-header h2 {
        font-size: 18px;
    }
}

/* Header Location Display */
.lbd-header-location-wrapper {
    display: inline-flex;
    align-items: center;
    position: relative;
    z-index: 1000;
    vertical-align: middle;
}

.lbd-header-location {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-left: 15px;
    font-size: 14px;
    white-space: nowrap;
    line-height: 1;
}

.lbd-header-location:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: #4CAF50;
    transform: translateY(-1px);
}

.lbd-location-icon {
    width: 16px;
    height: 16px;
    fill: #4CAF50;
    flex-shrink: 0;
    margin-right: 4px;
}

.lbd-location-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.2;
}

.lbd-location-name-row {
    display: flex;
    align-items: center;
    gap: 0;
}

.lbd-location-name {
    font-weight: 600;
    color: #333;
    font-size: 13px;
    line-height: 1;
}

.lbd-delivery-time {
    color: #4CAF50;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

/* Position beside logo - works with most WordPress themes */
body.admin-bar .lbd-header-location-wrapper {
    margin-top: 32px;
}

/* Integration with common header structures */
header .lbd-header-location-wrapper,
.site-header .lbd-header-location-wrapper,
.header .lbd-header-location-wrapper {
    display: inline-flex;
    vertical-align: middle;
}

/* Responsive Design for Header Location */
@media (max-width: 1024px) {
    .lbd-header-location {
        margin-left: 10px;
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .lbd-location-icon {
        width: 14px;
        height: 14px;
        margin-right: 3px;
    }
    
    .lbd-location-name {
        font-size: 12px;
    }
    
    .lbd-delivery-time {
        font-size: 10px;
        font-weight: 700;
    }
}

@media (max-width: 768px) {
    .lbd-header-location {
        margin-left: 8px;
        padding: 5px 10px;
        gap: 6px;
    }
    
    .lbd-location-text {
        display: none;
    }
    
    .lbd-header-location {
        border-radius: 50%;
        width: 36px;
        height: 36px;
        padding: 0;
        justify-content: center;
    }
    
    .lbd-location-icon {
        width: 20px;
        height: 20px;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .lbd-header-location {
        width: 32px;
        height: 32px;
    }
    
    .lbd-location-icon {
        width: 18px;
        height: 18px;
    }
    
    .lbd-header-location {
        margin-left: 5px;
    }
}
