﻿/* ============================================
   SIDEBAR GEO ADS - Professional Design CSS
   ============================================ */

/* Geo Ads Container */
.geo-ads-container {
    margin-bottom: 20px;
}

/* ============================================
   LOCATION SEARCH INTERFACE
   ============================================ */

.geo-ads-search-wrapper {
    margin-bottom: 15px;
    padding: 12px;
    background: #f7f7f7;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.geo-ads-search-help-text {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    padding: 8px 10px;
    background: #fff;
    border-left: 3px solid #2271b1;
    border-radius: 4px;
}

.geo-ads-search-help-text strong {
    color: #2271b1;
}

.geo-ads-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}

.geo-ads-search-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.geo-ads-search-btn,
.geo-ads-use-location-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 8px;
    margin-bottom: 4px;
}

.geo-ads-search-btn {
    background: #2271b1;
    color: white;
}

.geo-ads-search-btn:hover {
    background: #135e96;
    transform: translateY(-1px);
}

.geo-ads-use-location-btn {
    background: #fff;
    color: #2271b1;
    border: 1px solid #2271b1;
}

.geo-ads-use-location-btn:hover {
    background: #2271b1;
    color: white;
}

/* Selected Locations Chips */
.geo-ads-selected-locations {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.geo-location-chip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    background: #2271b1;
    color: white;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    animation: chipFadeIn 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 100%;
}

@media (min-width: 768px) {
    .geo-location-chip {
        min-width: auto;
    }
}

@keyframes chipFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.geo-location-chip-text {
    margin-right: 12px;
    font-weight: 500;
}

.geo-location-chip-radius-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 10px;
    border-radius: 6px;
    margin: 0 8px;
    gap: 6px;
}

.geo-radius-label {
    font-size: 12px;
    color: #2271b1;
    font-weight: 600;
    white-space: nowrap;
}

.geo-location-chip-radius {
    background: white;
    border: 2px solid #e0e0e0;
    color: #333;
    width: 70px;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
}

.geo-location-chip-radius:hover {
    border-color: #2271b1;
}

.geo-location-chip-radius:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
    transform: scale(1.05);
}

/* Show visual feedback when value is entered */
.geo-location-chip-radius:not(:placeholder-shown) {
    background: #e7f3ff;
    border-color: #2271b1;
    color: #135e96;
}

.geo-location-chip-radius::placeholder {
    color: #999;
    font-size: 12px;
    font-weight: normal;
}

.geo-radius-unit {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

/* Remove spinner arrows from number input */
.geo-location-chip-radius::-webkit-outer-spin-button,
.geo-location-chip-radius::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.geo-location-chip-radius {
    -moz-appearance: textfield;
}

.geo-location-chip-remove {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    margin-left: 8px;
    flex-shrink: 0;
}

.geo-location-chip-remove:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Mobile Responsive Styles */
@media (max-width: 767px) {
    .geo-location-chip {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .geo-location-chip-text {
        flex: 1 1 100%;
        margin-bottom: 8px;
        margin-right: 0;
    }
    
    .geo-location-chip-radius-wrapper {
        flex: 1 1 auto;
        margin: 0;
        margin-right: 8px;
    }
    
    .geo-radius-label {
        font-size: 11px;
    }
    
    .geo-location-chip-radius {
        width: 60px;
        padding: 6px 8px;
        font-size: 13px;
    }
    
    .geo-radius-unit {
        font-size: 11px;
    }
    
    .geo-location-chip-remove {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
}

/* Loading State */
.geo-ads-loading {
    padding: 15px;
    text-align: center;
    color: #888;
    font-style: italic;
    background: rgba(0,0,0,0.05);
    border-radius: 6px;
}

/* Error Message */
.geo-ads-error {
    padding: 12px;
    background-color: #f8d7da;
    color: #721c24;
    border-radius: 6px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 14px;
}

/* ============================================
   INDIVIDUAL AD STYLING
   ============================================ */

.geo-ad {
    margin-bottom: 24px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.geo-ad:hover {
    transform: translateY(-4px);
}

.geo-ad:last-child {
    margin-bottom: 0;
}

/* ============================================
   IMAGE CONTAINER & OVERLAY
   ============================================ */

.geo-ad-image {
    position: relative;
    border-radius: 10px;
    background: #f5f5f5;
    display: inline-block;
}

/* Main link covers entire image */
.geo-ad-image > a:first-child {
    display: block;
    position: relative;
    z-index: 5;
}

.geo-ad img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transition: filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.geo-ad:hover img {
    filter: brightness(0.93);
}

/* ============================================
   ACTION BUTTONS OVERLAY
   ============================================ */

.geo-ad-actions {
    position: absolute;
    bottom: 8px;
    left: 6px;
    right: 6px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    z-index: 25;
    pointer-events: none;
}

/* Base Button Styles */
.geo-ad-phone,
.geo-ad-map {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    position: relative;
    pointer-events: auto;
}

.geo-ad-phone svg,
.geo-ad-map svg {
    width: 21px;
    height: 21px;
    transition: transform 0.2s ease;
}

/* ============================================
   PHONE BUTTON (Green/WhatsApp Color)
   ============================================ */

.geo-ad-phone {
    background: linear-gradient(135deg, #25d366 0%, #20ba5b 100%);
    color: white;
}

.geo-ad-phone:hover {
    background: linear-gradient(135deg, #2ae580 0%, #22c55e 100%);
    transform: scale(1.12) rotate(5deg);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.geo-ad-phone:hover svg {
    transform: scale(1.1);
}

.geo-ad-phone:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

/* ============================================
   MAP BUTTON (Blue/Google Maps Color)
   ============================================ */

.geo-ad-map {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.geo-ad-map:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    transform: scale(1.12) rotate(-5deg);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.geo-ad-map:hover svg {
    transform: scale(1.1);
}

.geo-ad-map:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* ============================================
   MOBILE RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .geo-ad {
        margin-bottom: 20px;
    }
    
    .geo-ad-actions {
        bottom: 6px;
        left: 5px;
        right: 5px;
    }
    
    .geo-ad-phone,
    .geo-ad-map {
        width: 38px;
        height: 38px;
    }
    
    .geo-ad-phone svg,
    .geo-ad-map svg {
        width: 19px;
        height: 19px;
    }
}

@media (max-width: 480px) {
    .geo-ad-actions {
        bottom: 5px;
        left: 4px;
        right: 4px;
    }
    
    .geo-ad-phone,
    .geo-ad-map {
        width: 36px;
        height: 36px;
    }
    
    .geo-ad-phone svg,
    .geo-ad-map svg {
        width: 18px;
        height: 18px;
    }
}

/* ============================================
   THREE COLUMN LAYOUT
   ============================================ */

.geo-ads-three-column {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.geo-ads-column {
    padding: 0 15px;
    box-sizing: border-box;
}

.geo-ads-left {
    width: 25%;
}

.geo-ads-center {
    width: 50%;
}

.geo-ads-right {
    width: 25%;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .geo-ads-left,
    .geo-ads-center,
    .geo-ads-right {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .geo-ads-left,
    .geo-ads-right {
        order: 2;
    }
    
    .geo-ads-center {
        order: 1;
    }
}

/* ============================================
   ACCESSIBILITY & FOCUS STATES
   ============================================ */

.geo-ad-phone:focus,
.geo-ad-map:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* ============================================
   SMOOTH ANIMATIONS
   ============================================ */

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

.geo-ad {
    animation: fadeIn 0.4s ease-out;
}
