/**
 * Bilbordia OOH Campaigns - Public Styles
 * 
 * @package Bilbordia_OOH_Campaigns
 */

/* Campaign Totals Display */
.bilbordia-campaign-totals {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.bilbordia-campaign-totals > div {
    margin-bottom: 15px;
}

.bilbordia-campaign-totals > div:last-child {
    margin-bottom: 0;
}

.campaign-total {
    font-size: 1.2em;
    color: #333;
}

.campaign-budget {
    color: #28a745;
}

.campaign-budget-remaining {
    color: #007bff;
}

.campaign-budget-progress {
    margin-top: 10px;
}

.campaign-budget-progress .progress {
    height: 25px;
    border-radius: 5px;
}

.campaign-budget-progress .progress-bar {
    font-weight: bold;
    line-height: 25px;
}

/* Campaign Date Picker */
.campaign-dates-wrapper {
    margin: 20px 0;
}

.campaign-dates-input {
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    width: 300px;
    font-size: 14px;
}

.campaign-dates-input:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Campaign Header */
.campaign-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.campaign-info {
    flex: 1;
}

.campaign-name {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 5px;
}

.campaign-name-display {
    display: block;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 4px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.campaign-dates {
    color: #6c757d;
    font-size: 0.9em;
}

.campaign-budget-display {
    text-align: right;
}

/* Inline Edit */
.campaign-inline-edit {
    display: inline-block;
    margin-left: 10px;
    cursor: pointer;
    color: #007bff;
}

.campaign-inline-edit:hover {
    text-decoration: underline;
}

/* Resource Selection */
.resource-selection {
    margin: 15px 0;
}

.resource-item {
    padding: 10px;
    margin: 5px 0;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.resource-item input[type="checkbox"] {
    margin-right: 10px;
}

.resource-info {
    flex: 1;
}

.resource-name {
    font-weight: bold;
    margin-bottom: 3px;
}

.resource-price {
    color: #28a745;
    font-size: 0.9em;
}

.resource-quantity {
    width: 60px;
    padding: 5px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

/* Loading States */
.bilbordia-loading {
    opacity: 0.6;
    pointer-events: none;
}

.bilbordia-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success/Error Messages */
.bilbordia-message {
    padding: 12px 20px;
    margin: 15px 0;
    border-radius: 4px;
    border: 1px solid;
}

.bilbordia-message.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

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

.bilbordia-message.info {
    color: #004085;
    background-color: #cce5ff;
    border-color: #b8daff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .campaign-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .campaign-budget-display {
        text-align: left;
        margin-top: 10px;
    }
    
    .resource-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .resource-quantity {
        margin-top: 10px;
    }
}

/* Integration with YITH Wishlist */
.yith-wcwl-wishlist-campaign-meta {
    margin-top: 20px;
}

/* Bulk Actions Enhancement */
.wishlist-bulk-actions-wrapper {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.bulk-actions-dates {
    display: inline-block;
    margin-left: 15px;
}

/* Map Integration Styles */
.campaign-map-container {
    height: 500px;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
}

.mapboxgl-popup-content {
    padding: 15px;
    min-width: 200px;
}

.map-popup-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.map-popup-price {
    color: #28a745;
    font-size: 1.1em;
}

.map-popup-details {
    margin-top: 10px;
    font-size: 0.9em;
    color: #6c757d;
}

/* Per-product / per-resource custom dates (campaign planner) */
.boohc-product-dates,
.boohc-resource-dates {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-top: 8px;
    font-size: 12px;
    width: 100%;
}

.boohc-product-dates__toggle,
.boohc-resource-dates__toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-weight: 500;
    cursor: pointer;
}

.boohc-custom-daterange {
    min-width: 140px;
    max-width: 180px;
    padding: 2px 6px;
    font-size: 12px;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 2;
    background: #fff;
}

/* Hide range until custom dates is activated */
.boohc-product-dates:not(.is-custom) .boohc-custom-daterange,
.boohc-resource-dates:not(.is-custom) .boohc-custom-daterange {
    display: none !important;
}

.boohc-product-dates.is-custom .boohc-custom-daterange,
.boohc-resource-dates.is-custom .boohc-custom-daterange {
    display: inline-block !important;
}

.daterangepicker.boohc-line-drp {
    z-index: 10050 !important;
}

.boohc-product-dates.is-custom .boohc-product-dates__source,
.boohc-resource-dates.is-custom .boohc-resource-dates__source {
    color: #555;
    font-style: italic;
}

.boohc-product-dates__source[hidden],
.boohc-resource-dates__source[hidden] {
    display: none !important;
}
