/* 
 * Billboard Ads Frontend Styles
 */

/* === Single Page === */
.wp-billboard-single {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.wp-billboard-content-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 20px;
}

.wp-billboard-info {
    flex: 2;
    min-width: 300px;
}

.wp-billboard-booking-sidebar {
    flex: 1;
    min-width: 300px;
    background: #fdfdfd;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.wp-billboard-image {
    margin-bottom: 20px;
}

.wp-billboard-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.wp-billboard-meta-details {
    background: #f5f5f5;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.wp-billboard-meta-details p {
    margin: 5px 0;
}

.wp-billboard-price-box {
    background: #e8f5e9;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 25px;
}

.wp-billboard-price-box span {
    font-size: 13px;
    color: #555;
}

.wp-billboard-price-box .price-val {
    color: #2e7d32;
    margin: 5px 0 0;
}

.wp-billboard-price-box .price-val small {
    font-size: 14px;
    font-weight: normal;
    color: #666;
}

/* === Legend === */
.wp-billboard-legend {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 15px;
    font-size: 12px;
    margin-bottom: 15px;
}

.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 4px;
}

.legend-dot.free {
    background: #c8e6c9;
    border: 1px solid #a5d6a7;
}

.legend-dot.reserved {
    background: #fff9c4;
    border: 1px solid #fff176;
}

.legend-dot.booked {
    background: #ffcdd2;
    border: 1px solid #ef9a9a;
}

/* === Calendar Grid === */
.wp-billboard-calendar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.month-slot {
    border: 2px solid transparent;
    padding: 6px 4px;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    font-size: 12px;
    font-weight: 600;
    user-select: none;
    white-space: nowrap;
    min-width: 0;
}

.month-slot.free {
    background: #c8e6c9;
    color: #1b5e20;
    border-color: #a5d6a7;
}

.month-slot.free:hover {
    background: #a5d6a7;
    border-color: #66bb6a;
}

.month-slot.reserved {
    background: #fff9c4;
    color: #f57f17;
    border-color: #fff176;
    cursor: not-allowed;
}

.month-slot.booked {
    background: #ffcdd2;
    color: #b71c1c;
    border-color: #ef9a9a;
    cursor: not-allowed;
}

.month-slot.selected {
    background: #bbdefb;
    border-color: #1976d2;
    color: #0d47a1;
    box-shadow: 0 0 0 2px #1976d2;
}

/* === Booking Summary === */
.booking-summary {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.total-price {
    font-size: 18px;
}

.wp-billboard-btn-primary {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: #1976d2;
    color: #fff;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s;
    margin-top: 10px;
}

.wp-billboard-btn-primary:hover {
    background: #1565c0;
    color: #fff;
}

#booking-msg {
    margin-top: 10px;
}

/* === Toast Notifications === */
.wp-billboard-toast {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    animation: toastSlideIn 0.35s ease-out;
}

.wp-billboard-toast.success {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}

.wp-billboard-toast.error {
    background: #ffebee;
    border: 1px solid #ef9a9a;
    color: #c62828;
}

.wp-billboard-btn-cart-link {
    display: inline-block;
    padding: 8px 18px;
    background: #1976d2;
    color: #fff !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.2s;
}

.wp-billboard-btn-cart-link:hover {
    background: #1565c0;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Archive Page === */
.wp-billboard-archive {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.wp-billboard-map-container {
    margin-bottom: 30px;
}

/* Filters */
.wp-billboard-filter-bar {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.wp-billboard-filter-bar form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

.filter-group select {
    padding: 8px 12px;
    min-width: 200px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.filter-submit {
    display: flex;
    gap: 10px;
}

/* Card Grid */
.wp-billboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.wp-billboard-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.wp-billboard-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.wp-billboard-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.wp-billboard-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.wp-billboard-card-meta {
    font-size: 13px;
    color: #666;
    margin: 8px 0 15px;
}

.wp-billboard-card-price {
    font-size: 18px;
    margin-top: auto;
    margin-bottom: 15px;
}

.wp-billboard-card-content .view-btn {
    margin-top: auto;
}

/* Leaflet popup */
.leaflet-popup-content-wrapper {
    border-radius: 6px;
}

.leaflet-popup-content img {
    width: 100%;
    height: auto;
    margin-bottom: 8px;
    border-radius: 4px;
}

.leaflet-popup-content h4 {
    margin: 5px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .wp-billboard-content-wrapper {
        flex-direction: column;
    }

    .wp-billboard-calendar {
        grid-template-columns: repeat(3, 1fr);
    }

    .wp-billboard-filter-bar form {
        flex-direction: column;
    }

    .wp-billboard-sel-row {
        flex-direction: column;
    }

    .wp-billboard-sel-months-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* === Frontend Selection Shortcode === */
.wp-billboard-selection-frontend {
    max-width: 100%;
    margin: 0 auto;
}

.wp-billboard-sel-form {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.wp-billboard-sel-filters {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wp-billboard-sel-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.wp-billboard-sel-group {
    flex: 1;
    min-width: 150px;
}

.wp-billboard-sel-group label,
.wp-billboard-sel-months>label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: #333;
}

.wp-billboard-sel-group select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
    background: #fff;
}

.wp-billboard-sel-months-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.wp-billboard-sel-month-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    user-select: none;
    text-align: center;
}

.wp-billboard-sel-month-chip input[type="checkbox"] {
    display: none;
}

.wp-billboard-sel-month-chip:hover {
    border-color: #1976d2;
    background: #e3f2fd;
}

.wp-billboard-sel-month-chip.checked,
.wp-billboard-sel-month-chip:has(input:checked) {
    background: #bbdefb;
    border-color: #1976d2;
    color: #0d47a1;
    font-weight: 600;
}

.wp-billboard-sel-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.wp-billboard-btn-secondary {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid #ccc;
    border-radius: 8px;
    background: #fff;
    color: #555;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
}

.wp-billboard-btn-secondary:hover {
    border-color: #999;
    color: #333;
}

.wp-billboard-sel-results h3 {
    margin-bottom: 20px;
    font-size: 18px;
    color: #333;
}

.wp-billboard-no-results {
    padding: 20px;
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    border-radius: 4px;
    color: #e65100;
}