/**
 * Billboard CRM Frontend Styles
 * 
 * Frontend compatibility with any theme using core WordPress classes
 * and minimal scoped CSS with unique prefix (.bpcrm-*)
 */

/* ================================
   CSS Variables (can be overridden by settings)
   ================================ */
:root {
    --bpcrm-primary-color: #007cba;
    --bpcrm-reservation-color: #ffc107;
    --bpcrm-calendar-bg: #ffffff;
    --bpcrm-success-color: #28a745;
    --bpcrm-error-color: #dc3545;
    --bpcrm-warning-color: #ffc107;
    --bpcrm-info-color: #17a2b8;
}

/* ================================
   General Components
   ================================ */

.bpcrm-notice {
    padding: 12px;
    margin: 15px 0;
    border-left: 4px solid;
    border-radius: 3px;
}

.bpcrm-notice-info {
    background-color: #e3f2fd;
    border-color: var(--bpcrm-info-color);
    color: #0d47a1;
}

.bpcrm-notice-success {
    background-color: #e8f5e8;
    border-color: var(--bpcrm-success-color);
    color: #155724;
}

.bpcrm-notice-warning {
    background-color: #fff3cd;
    border-color: var(--bpcrm-warning-color);
    color: #856404;
}

.bpcrm-notice-error {
    background-color: #f8d7da;
    border-color: var(--bpcrm-error-color);
    color: #721c24;
}

/* ================================
   Map Components
   ================================ */

.bpcrm-map-container {
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.bpcrm-map {
    width: 100%;
    min-height: 400px;
}

/* Map Mobile Controls */
.bpcrm-map-mobile-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: none;
    flex-direction: column;
    gap: 8px;
}

.bpcrm-map-control-btn {
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    font-size: 12px;
    min-width: 40px;
    text-align: center;
    transition: all 0.2s ease;
}

.bpcrm-map-control-btn:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

.bpcrm-map-control-btn:active {
    transform: translateY(0);
}

/* ================================
   Empty States
   ================================ */

.bpcrm-empty-state,
.bpcrm-map-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    background: #fafafa;
    border-radius: 8px;
    margin: 20px 0;
}

.bpcrm-empty-state-icon {
    margin-bottom: 20px;
    opacity: 0.6;
}

.bpcrm-empty-state-icon svg {
    color: #999;
}

.bpcrm-empty-state-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #333;
}

.bpcrm-empty-state-message {
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 20px 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.bpcrm-retry-btn {
    background: var(--bpcrm-primary-color) !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    transition: background-color 0.2s ease !important;
}

.bpcrm-retry-btn:hover {
    background: #005a87 !important;
}

/* Different empty state types */
.bpcrm-empty-state-no-panels {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
}

.bpcrm-empty-state-calendar-error {
    background: #fff5f5;
    border: 2px dashed #fed7d7;
}

.bpcrm-empty-state-calendar-error .bpcrm-empty-state-icon svg {
    color: #e53e3e;
}

.bpcrm-empty-state-connection-error {
    background: #fff5f5;
    border: 2px dashed #fed7d7;
}

.bpcrm-empty-state-connection-error .bpcrm-empty-state-icon svg {
    color: #e53e3e;
}

.bpcrm-empty-state-no-data .bpcrm-empty-state-icon svg {
    color: #4299e1;
}

/* Legacy error class for backwards compatibility */
.bpcrm-error {
    text-align: center;
    padding: 40px 20px;
    color: var(--bpcrm-error-color);
    font-size: 16px;
}

/* Map Info Window Styles */
.bpcrm-info-window {
    max-width: 300px;
    font-family: inherit;
}

.bpcrm-info-image img {
    width: 100%;
    height: auto;
    max-height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.bpcrm-info-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: bold;
}

.bpcrm-info-address {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
}

.bpcrm-info-details {
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bpcrm-info-size,
.bpcrm-info-price {
    font-size: 12px;
    padding: 2px 6px;
    background: #f0f0f0;
    border-radius: 3px;
}

.bpcrm-info-description {
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.4;
}

.bpcrm-info-actions {
    margin-top: 10px;
    display: flex;
    gap: 5px;
}

.bpcrm-info-actions .button {
    font-size: 12px;
    padding: 4px 8px;
    line-height: 1.2;
}

/* ================================
   Table Components
   ================================ */

.bpcrm-table-container {
    margin: 20px 0;
}

.bpcrm-billboards-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
}

.bpcrm-billboards-table th,
.bpcrm-billboards-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.bpcrm-billboards-table th {
    background: #f9f9f9;
    font-weight: 600;
}

.bpcrm-billboards-table img {
    max-width: 60px;
    height: auto;
    border-radius: 3px;
}

/* ================================
   Status Badges
   ================================ */

.bpcrm-status-badge,
.bpcrm-size-badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.bpcrm-status-badge.status-available {
    background-color: #d4edda;
    color: #155724;
}

.bpcrm-status-badge.status-reserved {
    background-color: #fff3cd;
    color: #856404;
}



.bpcrm-status-badge.status-pending {
    background-color: #d1ecf1;
    color: #0c5460;
}

.bpcrm-size-badge.size-small {
    background-color: #e2e3e5;
    color: #383d41;
}

.bpcrm-size-badge.size-medium {
    background-color: #d4edda;
    color: #155724;
}

.bpcrm-size-badge.size-large {
    background-color: #fff3cd;
    color: #856404;
}

/* ================================
   Calendar Components
   ================================ */

.bpcrm-calendar-container {
    margin: 20px 0;
    background: var(--bpcrm-calendar-bg);
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.bpcrm-reservation-cart {
    background: #f9f9f9;
    padding: 20px;
    border-bottom: 1px solid #ddd;
}

.bpcrm-cart-items {
    margin: 15px 0;
}

.bpcrm-cart-item {
    background: #fff;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bpcrm-cart-item-details h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
}

.bpcrm-cart-item-dates {
    margin: 0;
    color: #666;
    font-size: 12px;
}

.bpcrm-cart-item-price {
    font-weight: bold;
    color: var(--bpcrm-primary-color);
}

.bpcrm-cart-total {
    margin: 15px 0;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.bpcrm-cart-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.bpcrm-calendar-controls {
    background: #f9f9f9;
    padding: 15px;
    border-bottom: 1px solid #ddd;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.bpcrm-billboard-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bpcrm-billboard-select {
    min-width: 200px;
}

.bpcrm-view-controls {
    display: flex;
    gap: 5px;
}

.bpcrm-view-btn.active {
    background-color: var(--bpcrm-primary-color);
    color: #fff;
}

.bpcrm-calendar {
    padding: 20px;
}

.bpcrm-calendar-legend {
    background: #f9f9f9;
    padding: 15px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.bpcrm-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.bpcrm-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
}

.bpcrm-legend-color.available {
    background-color: var(--bpcrm-success-color);
}

.bpcrm-legend-color.reserved {
    background-color: var(--bpcrm-error-color);
}



.bpcrm-legend-color.pending {
    background-color: var(--bpcrm-reservation-color);
}

.bpcrm-empty-cart {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 20px 0;
}

/* ================================
   Offer Form Components
   ================================ */

.bpcrm-offer-form-container {
    margin: 20px 0;
}

.bpcrm-cart-summary {
    background: #f9f9f9;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 30px;
}

.bpcrm-cart-summary h3 {
    margin-top: 0;
}

.bpcrm-cart-summary-items {
    margin: 15px 0;
}

.bpcrm-cart-summary-item {
    background: #fff;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bpcrm-cart-summary-total {
    border-top: 2px solid #ddd;
    padding-top: 15px;
    margin-top: 15px;
    text-align: center;
}

.bpcrm-price-note {
    font-size: 12px;
    color: #666;
    margin: 5px 0 0 0;
}

.bpcrm-offer-form h3 {
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin: 30px 0 20px 0;
}

.bpcrm-offer-form h3:first-of-type {
    margin-top: 0;
}

.bpcrm-form-actions {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.bpcrm-form-actions .button {
    margin: 0 5px;
}

/* ================================
   Dashboard Components
   ================================ */

.bpcrm-dashboard {
    margin: 20px 0;
}

.bpcrm-dashboard-header {
    text-align: center;
    margin-bottom: 30px;
}

.bpcrm-dashboard-intro {
    color: #666;
    font-size: 16px;
    margin: 10px 0;
}

.bpcrm-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.bpcrm-stat-box {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    border-left: 4px solid var(--bpcrm-primary-color);
}

.bpcrm-stat-number {
    font-size: 36px;
    font-weight: bold;
    color: var(--bpcrm-primary-color);
    margin-bottom: 5px;
}

.bpcrm-stat-label {
    color: #666;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bpcrm-dashboard-actions {
    text-align: center;
    margin: 30px 0;
}

.bpcrm-dashboard-actions .button {
    margin: 0 5px 10px 5px;
}

.bpcrm-offers-section {
    margin: 40px 0;
}

.bpcrm-offers-table-container {
    overflow-x: auto;
}

.bpcrm-offers-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
}

.bpcrm-offers-table th,
.bpcrm-offers-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.bpcrm-offers-table th {
    background: #f9f9f9;
    font-weight: 600;
}

.bpcrm-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.bpcrm-empty-state {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.bpcrm-quick-links {
    margin: 40px 0;
}

.bpcrm-quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.bpcrm-quick-link {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.bpcrm-quick-link h4 {
    margin: 0 0 10px 0;
    color: var(--bpcrm-primary-color);
}

.bpcrm-quick-link p {
    color: #666;
    font-size: 14px;
    margin: 10px 0 15px 0;
}

/* ================================
   Button Overrides
   ================================ */

.bpcrm-reserve-btn,
.button.bpcrm-primary {
    background-color: var(--bpcrm-primary-color) !important;
    border-color: var(--bpcrm-primary-color) !important;
    color: #fff !important;
}

.bpcrm-reserve-btn:hover,
.button.bpcrm-primary:hover {
    background-color: #005a87 !important;
    border-color: #005a87 !important;
}

/* ================================
   Responsive Design
   ================================ */

@media (max-width: 768px) {
    /* Map optimizations for tablets */
    .bpcrm-map-container {
        margin: 15px 0;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .bpcrm-map {
        min-height: 350px;
        border-radius: 8px;
    }

    .bpcrm-map-mobile-controls {
        display: flex;
    }

    /* Info window mobile optimization */
    .bpcrm-info-window {
        max-width: 250px;
        font-size: 12px;
    }

    .bpcrm-info-title {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .bpcrm-info-address {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .bpcrm-info-actions .button {
        padding: 6px 12px;
        font-size: 11px;
        margin: 2px;
    }

    /* Calendar optimizations for tablets */
    .bpcrm-calendar-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 15px;
    }
    
    .bpcrm-cart-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
        border-radius: 8px;
    }
    
    .bpcrm-cart-actions {
        flex-direction: column;
        gap: 8px;
    }

    .bpcrm-cart-actions .button {
        width: 100%;
        padding: 12px;
        font-size: 14px;
        border-radius: 6px;
    }
    
    .bpcrm-dashboard-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .bpcrm-stat-box {
        padding: 15px;
        border-radius: 8px;
        text-align: center;
    }
    
    .bpcrm-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .bpcrm-form-actions .button {
        display: block;
        width: 100%;
        margin: 5px 0;
        padding: 12px;
        font-size: 14px;
        border-radius: 6px;
    }

    /* Table responsiveness */
    .bpcrm-billboards-table {
        font-size: 13px;
    }

    .bpcrm-billboards-table th,
    .bpcrm-billboards-table td {
        padding: 8px 6px;
    }

    /* Enhanced touch targets */
    .button,
    .bpcrm-reserve-btn {
        min-height: 44px;
        touch-action: manipulation;
    }
}

@media (max-width: 480px) {
    /* Map optimizations for phones */
    .bpcrm-map-container {
        margin: 10px 0;
        border-radius: 6px;
    }

    .bpcrm-map {
        min-height: 300px;
        border-radius: 6px;
    }

    .bpcrm-map-control-btn {
        padding: 6px;
        min-width: 36px;
        font-size: 11px;
    }

    /* Info window phone optimization */
    .bpcrm-info-window {
        max-width: 200px;
        font-size: 11px;
        padding: 8px;
    }

    .bpcrm-info-title {
        font-size: 13px;
        margin-bottom: 3px;
    }

    .bpcrm-info-address {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .bpcrm-info-details {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .bpcrm-info-actions .button {
        padding: 4px 8px;
        font-size: 10px;
        margin: 1px;
        border-radius: 4px;
    }

    /* Calendar phone optimizations */
    .bpcrm-view-controls {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }

    .bpcrm-view-controls .button {
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Cart optimizations for phones */
    .bpcrm-cart-item {
        padding: 10px;
        border-radius: 6px;
        gap: 8px;
    }

    .bpcrm-cart-item-details h4 {
        font-size: 13px;
        margin-bottom: 3px;
    }

    .bpcrm-cart-item-dates {
        font-size: 11px;
    }

    .bpcrm-cart-item-price {
        font-size: 14px;
        font-weight: bold;
    }

    .bpcrm-cart-actions .button {
        padding: 10px;
        font-size: 13px;
    }

    /* Dashboard phone optimizations */
    .bpcrm-stat-box {
        padding: 12px;
    }

    .bpcrm-stat-number {
        font-size: 20px;
    }

    .bpcrm-stat-label {
        font-size: 11px;
    }
    
    /* Table phone optimizations */
    .bpcrm-offers-table-container {
        font-size: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .bpcrm-billboards-table {
        min-width: 300px;
        font-size: 11px;
    }

    .bpcrm-billboards-table th,
    .bpcrm-billboards-table td {
        padding: 6px 4px;
    }

    .bpcrm-billboards-table img {
        width: 40px;
        height: 30px;
    }
    
    .bpcrm-quick-links-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .bpcrm-quick-link {
        padding: 12px;
        border-radius: 8px;
    }

    .bpcrm-quick-link h4 {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .bpcrm-quick-link p {
        font-size: 12px;
    }

    /* Form optimizations */
    .bpcrm-form-actions .button {
        padding: 10px;
        font-size: 13px;
    }

    /* Enhanced touch areas for phones */
    .button,
    .bpcrm-reserve-btn {
        min-height: 48px;
        font-size: 14px;
        border-radius: 8px;
    }

    /* Status badges phone optimization */
    .bpcrm-status-badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    .bpcrm-size-badge {
        font-size: 9px;
        padding: 2px 4px;
    }
}

/* ================================
   WordPress Core Classes Integration
   ================================ */

.bpcrm-dashboard .entry-content,
.bpcrm-offer-form-container .entry-content {
    /* Inherit theme typography */
}

/* Ensure compatibility with WordPress block styles */
.wp-block .bpcrm-map-container,
.wp-block .bpcrm-table-container,
.wp-block .bpcrm-calendar-container {
    margin: 1.5em 0;
}

/* Print styles */
@media print {
    .bpcrm-map,
    .bpcrm-calendar,
    .button,
    .bpcrm-form-actions {
        display: none !important;
    }
    
    .bpcrm-offers-table,
    .bpcrm-dashboard-stats {
        break-inside: avoid;
    }
}

/* Timeline Hack CSS for Panel Grouping */
.bpcrm-calendar-container.bpcrm-panel-selected {
    position: relative;
}

.bpcrm-calendar-container.bpcrm-panel-selected::before {
    content: "Panel: " attr(data-current-panel);
    position: absolute;
    top: -30px;
    left: 0;
    font-weight: bold;
    background: #f0f0f0;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    z-index: 10;
}

/* Panel Event Grouping */
.fc-event.bpcrm-calendar-event {
    position: relative;
    border-left: 3px solid transparent;
}

.fc-event.panel-1 { border-left-color: #007cba; }
.fc-event.panel-2 { border-left-color: #28a745; }
.fc-event.panel-3 { border-left-color: #dc3545; }
.fc-event.panel-4 { border-left-color: #ffc107; }
.fc-event.panel-5 { border-left-color: #6f42c1; }

/* Visual spacing between panel groups */
.fc-event.bpcrm-panel-group-0 { margin-top: 2px; }
.fc-event.bpcrm-panel-group-1 { margin-top: 4px; }
.fc-event.bpcrm-panel-group-2 { margin-top: 6px; }
.fc-event.bpcrm-panel-group-3 { margin-top: 8px; }
.fc-event.bpcrm-panel-group-4 { margin-top: 10px; }

/* Current panel highlighting */
.fc-event.bpcrm-current-panel-event {
    box-shadow: 0 0 0 2px #007cba;
    z-index: 5;
}

.fc-event.bpcrm-current-panel {
    opacity: 1;
    transform: scale(1.02);
}

/* Event content styling for timeline hack */
.bpcrm-event-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 100%;
}

.bpcrm-event-panel {
    font-size: 10px;
    opacity: 0.8;
    font-weight: bold;
    text-transform: uppercase;
}

.bpcrm-event-title {
    font-size: 11px;
    font-weight: normal;
}

/* Status-based color coding */
.fc-event.status-available {
    background-color: #28a745;
    border-color: #1e7e34;
}

.fc-event.status-reserved {
    background-color: #dc3545;
    border-color: #c82333;
}

.fc-event.status-pending {
    background-color: #ffc107;
    border-color: #e0a800;
    color: #000;
}



/* Type-based styling */
.fc-event.type-existing_reservation {
    opacity: 0.9;
}

.fc-event.type-cart_item {
    border-style: dashed;
    opacity: 0.85;
}

/* Panel selector enhancement */
.bpcrm-billboard-selector {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.bpcrm-billboard-selector label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

.bpcrm-billboard-select {
    width: 100%;
    max-width: 300px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Calendar container adjustments for timeline hack */
.bpcrm-calendar {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

/* Week view enhancements for better timeline simulation */
.fc-timeGridWeek-view .fc-event {
    min-height: 20px;
}

.fc-timeGridWeek-view .bpcrm-event-content {
    padding: 2px;
}

/* Month view adjustments */
.fc-dayGridMonth-view .fc-event {
    margin-bottom: 1px;
}

/* Legend updates for panel grouping */
.bpcrm-calendar-legend {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.bpcrm-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.bpcrm-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
}

.bpcrm-legend-color.available { background-color: #28a745; }
.bpcrm-legend-color.reserved { background-color: #dc3545; }
.bpcrm-legend-color.occupied { background-color: #6c757d; }
.bpcrm-legend-color.pending { background-color: #ffc107; }

/* Reservation indicators and details */
.bpcrm-reservation-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background-color: #dc3545;
    border-radius: 50%;
    z-index: 2;
}

.bpcrm-day-cell.reserved .bpcrm-reservation-indicator {
    background-color: #ffffff;
    border: 2px solid #dc3545;
    width: 6px;
    height: 6px;
}

.bpcrm-day-cell.pending .bpcrm-reservation-indicator {
    background-color: #000;
}

/* Remove all decoration from reserved and pending cells - they should look normal */
.bpcrm-day-cell.reserved,
.bpcrm-day-cell.pending {
    background-color: transparent !important;
    /* No special styling for the cell itself, only the bar */
}

/* Calendar matrix improvements for new endpoint data */
.bpcrm-calendar-matrix {
    position: relative;
}

.bpcrm-day-cell {
    position: relative;
    overflow: visible;
}

/* Status indicators for different entity types */
.bpcrm-day-cell[data-reservation-type="OFFER"] .bpcrm-reservation-indicator {
    background-color: #28a745;
}

.bpcrm-day-cell[data-reservation-type="CONTRACT"] .bpcrm-reservation-indicator {
    background-color: #007bff;
}

.bpcrm-day-cell[data-reservation-type="BOOKING"] .bpcrm-reservation-indicator {
    background-color: #ffc107;
}

/* Reservation bars - continuous over the entire period */
.bpcrm-day-cell.reserved {
    position: relative;
}

/* Hide individual cell content for reservations */
.bpcrm-day-cell.reserved::after {
    display: none;
}

/* Create reservation bar on first day of reservation */
.bpcrm-day-cell.reserved.reservation-start::before {
    content: attr(data-reservation-title);
    position: absolute;
    top: 25%;
    left: 2px;
    width: calc(var(--reservation-span, 1) * 100% - 6px);
    height: 50%;
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    font-size: 9px;
    font-weight: 500;
    padding: 1px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: visible;
    z-index: 3;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    text-shadow: none;
    pointer-events: auto;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
}

/* Hover effect on reservation bar */
.bpcrm-day-cell.reserved.reservation-start:hover::before {
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}

/* Hover effect on cart bar */
.bpcrm-day-cell.pending.cart-start:hover::before {
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}

/* Use dynamic colors for reserved bars - colors set via data attribute */
.bpcrm-day-cell.reserved.reservation-start::before {
    background: var(--reservation-color, linear-gradient(135deg, #dc3545, #c82333)) !important;
    color: var(--reservation-text-color, white) !important;
}

/* Pending (cart) items should be YELLOW bars - higher priority than reserved */
.bpcrm-day-cell.pending.cart-start::before {
    content: attr(data-pending-text) !important;
    position: absolute;
    top: 25%;
    left: 2px;
    width: calc(var(--cart-span, 1) * 100% - 6px);
    height: 50%;
    background: linear-gradient(135deg, #ffc107, #e0a800) !important;
    color: #fff !important;
    font-size: 9px;
    font-weight: 500;
    padding: 1px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: visible;
    z-index: 4;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    text-shadow: none;
    pointer-events: auto;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
}

/* Ensure all reserved and pending cells have transparent background */
.bpcrm-day-cell.reserved,
.bpcrm-day-cell.pending {
    background-color: transparent !important;
}

/* Remove individual reservation indicators from all reserved and pending cells since we use bars now */
.bpcrm-day-cell.reserved .bpcrm-reservation-indicator,
.bpcrm-day-cell.pending .bpcrm-reservation-indicator {
    display: none;
}

/* Reservation details modal */
.bpcrm-reservation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bpcrm-reservation-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.bpcrm-modal-header {
    padding: 20px 20px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bpcrm-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.bpcrm-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.bpcrm-modal-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

.bpcrm-modal-body {
    padding: 20px;
}

.bpcrm-reservation-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bpcrm-info-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.bpcrm-info-row:last-child {
    border-bottom: none;
}

.bpcrm-info-row strong {
    min-width: 100px;
    color: #555;
    margin-right: 10px;
}

.bpcrm-modal-footer {
    padding: 15px 20px 20px;
    text-align: right;
    border-top: 1px solid #eee;
}

.bpcrm-modal-footer .button {
    min-width: 80px;
}

/* Responsive modal */
@media (max-width: 600px) {
    .bpcrm-reservation-modal {
        width: 95%;
        margin: 10px;
    }
    
    .bpcrm-modal-header,
    .bpcrm-modal-body,
    .bpcrm-modal-footer {
        padding: 15px;
    }
    
    .bpcrm-info-row {
        flex-direction: column;
        gap: 4px;
    }
    
    .bpcrm-info-row strong {
        min-width: auto;
        margin-right: 0;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .bpcrm-calendar-container.bpcrm-panel-selected::before {
        position: relative;
        top: 0;
        margin-bottom: 10px;
        display: block;
    }
    
    .bpcrm-event-panel {
        display: none; /* Hide panel code on mobile */
    }
    
    .bpcrm-calendar-legend {
        flex-direction: column;
        gap: 8px;
    }
}

/* Panel Page Styles - Flat Design */
.panel-info-grid {
    gap: 2rem;
}

.panel-info-grid .wp-block-column {
    margin-bottom: 1.5rem;
}

.detail-row, .price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
    gap: 1rem;
}

.detail-row:hover, .price-row:hover {
    background-color: #f8f9fa;
}

.detail-row:last-child, .price-row:last-child {
    border-bottom: none;
}

.detail-row strong, .price-row strong {
    min-width: 150px;
    color: #2c3e50;
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1;
    letter-spacing: 0.5px;
}

.status-active {
    background-color: #28a745;
    color: white;
}

.status-inactive {
    background-color: #6c757d;
    color: white;
}

.archived-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    background-color: #ffc107;
    color: #212529;
    margin-left: 0.5rem;
}

.main-price .price, .total-price .price {
    font-size: 1.4rem;
    font-weight: 700;
    color: #28a745;
}

.total-price {
    border-top: 2px solid #28a745;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    font-weight: 700;
    font-size: 1.2rem;
    background-color: #f8f9fa;
    padding: 1.5rem;
    margin: 1.5rem 0 0 0;
}

.panel-actions {
    margin-top: 3rem;
    text-align: center;
}

.panel-actions .wp-block-button__link {
    border-radius: 4px;
    padding: 1rem 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-description {
    line-height: 1.8;
    margin: 1.5rem 0;
    font-size: 1.1rem;
    color: #495057;
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 4px;
    border-left: 4px solid #007cba;
}

.page-header {
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 2rem;
    border: 1px solid #e9ecef;
    border-top: 4px solid #007cba;
}

.page-header .page-title {
    margin-bottom: 1rem;
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
}

.page-header .entry-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-details, .pricing-details, .location-details, .metadata-details, .custom-fields {
    padding: 1rem 0;
}

.has-light-gray-background-color {
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.wp-block-group__inner-container {
    padding: 2rem;
}

.panel-info-grid h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 700;
    border-bottom: 2px solid #007cba;
    padding-bottom: 0.75rem;
}

.panel-info-grid h4 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #555;
    font-size: 1.1rem;
}

/* Additional enhancements */
.panel-details, .pricing-details, .location-details, .metadata-details, .custom-fields {
    padding: 1.5rem 0;
}

.panel-info-grid h4 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #495057;
    font-size: 1.2rem;
    font-weight: 600;
    position: relative;
    padding-left: 1rem;
}

.panel-info-grid h4::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #007cba;
    font-weight: bold;
}

/* Content area styling */
.content-area {
    background-color: #ffffff;
    min-height: 100vh;
    padding: 2rem 0;
}

/* Enhanced mobile responsive adjustments */
@media (max-width: 768px) {
    .detail-row, .price-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 1rem 0;
    }
    
    .detail-row:hover, .price-row:hover {
        background-color: #f8f9fa;
    }
    
    .detail-row strong, .price-row strong {
        min-width: auto;
        font-size: 0.95rem;
        margin-bottom: 0.25rem;
    }
    
    .page-header {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .page-header .page-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .page-header .entry-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .wp-block-group__inner-container {
        padding: 1.5rem;
    }
    
    .main-price .price, .total-price .price {
        font-size: 1.2rem;
    }
    
    .total-price {
        margin: 1.5rem 0 0 0;
        padding: 1rem;
    }
    
    .panel-description {
        padding: 1rem;
        margin: 1rem 0;
    }
    

    
    .content-area {
        padding: 1rem 0;
    }
} 