/* Base widget styles */
.dvc-point-calculator,
.dvc-point-calculator-full {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    position: relative;
}

/* Full page layout */
.dvc-point-calculator-full {
    display: flex;
    gap: 30px;
    margin: 20px 0;
    position: relative;
}

/* Filter section */
.dvc-point-calculator-full .filter-section {
    width: 340px;
    min-width: 300px;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: fit-content;
    z-index: 1;
}

.dvc-point-calculator-full .calculator-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 0;
}

/* Calculator controls and tables */
.dvc-point-calculator-full .controls,
.dvc-point-calculator-full #resortTables {
    position: relative;
    background: #fff;
    z-index: 0;
}

.dvc-point-calculator-full .controls {
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Responsive styles */
@media (max-width: 1024px) {
    .dvc-point-calculator-full {
        flex-direction: column !important; /* Override any custom direction on mobile */
    }

    .dvc-point-calculator-full .filter-section {
        width: 100%;
        position: relative;
        top: 0;
    }
}

/* Filter Section Styles */
.dvc-resort-filter {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Location Groups */
.location-groups {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.location-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.location-group:last-child {
    border-bottom: none;
}

/* Location Parent Checkbox */
.location-group > .checkbox-label {
    font-weight: 600;
    font-size: 1.1em;
    color: #1a237e;
    padding: 5px 0;
}

/* Resort Group */
.resort-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 20px;
}

/* Checkbox Labels */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 2px 0;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.checkbox-label span {
    font-size: 0.95em;
    line-height: 1.4;
}

/* Resort Checkboxes */
.resort-group .checkbox-label {
    color: #333;
}

.resort-group .checkbox-label:hover {
    color: #1a237e;
}

/* Reset Button */
.filter-actions {
    display: flex;
    justify-content: center;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.reset-filters {
    background: #f44336;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.reset-filters:hover {
    background: #d32f2f;
}

/* Loading State */
.location-groups[data-loading="true"] {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-message {
    color: #666;
    font-style: italic;
}

/* Date Picker Layouts */
.date-picker.inline {
    display: flex;
    gap: 20px;
}

.date-controls {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: center;
    justify-content: space-between;
}

.date-controls .date-input {
    width: 180px;
}

.date-picker-wrapper.inline .date-picker {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: center;
}

.date-picker-wrapper.vertical .date-picker {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Popup trigger button */
.calculator-popup-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calculator-popup-trigger .button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.calculator-popup-trigger .button-icon-before {
    margin-right: 4px;
}

.calculator-popup-trigger .button-icon-after {
    margin-left: 4px;
}

.error-message {
    padding: 15px;
    margin: 10px 0;
    background-color: #fff3f3;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    color: #b71c1c;
    text-align: center;
}

/* Points Cell Styles */
.points-cell {
    text-align: center;
    padding: 8px;
    line-height: 1.6;
}

.points-cell br {
    margin-bottom: 4px;
}

/* Loading Spinner Styles */
.dvc-loading-container {
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.dvc-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 40px;
}

.dvc-loading-spinner .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.dvc-loading-spinner .loading-text {
    color: #666;
    font-size: 16px;
    margin: 0;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dvc-loading-container:not(:has(.dvc-loading-spinner)) {
    min-height: auto;
}

/* Resort Table Styles */
.resort-section {
    width: 100%;
    margin-bottom: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.resort-header {
    background: #1a237e;
    color: white;
    padding: 12px 20px;
    font-size: 1.2em;
    font-weight: 600;
}

.resort-section table {
    width: 100%;
    border-collapse: collapse;
}

.resort-section th,
.resort-section td {
    border: 1px solid #e0e0e0;
    padding: 12px;
}

.resort-section th {
    background: #f5f5f5;
    font-weight: 600;
}

.room-name-cell {
    font-weight: 600;
    text-align: left;
    background: #fafafa;
}

.has-points {
    background: white;
}

.no-points {
    background: #f5f5f5;
    color: #999;
}

/* Hide elements with hidden class */
.hidden {
    display: none !important;
}

/* Filter Button Container */
.filter-button-container {
    display: flex;
    align-items: center;
    margin-left: auto;
}

/* Filter Button */
.dvc-filter-button {
    background: #1a237e;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dvc-filter-button:hover {
    background: #283593;
}

/* Filter Modal */
.dvc-filter-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dvc-filter-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.dvc-filter-modal-content {
    position: relative;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
}

.dvc-filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.dvc-filter-modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    color: #1a237e;
}

.dvc-filter-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.dvc-filter-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.dvc-filter-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.dvc-filter-modal-body .filter-section {
    width: 100%;
    position: relative;
    top: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
    min-width: auto;
}

/* Responsive modal */
@media (max-width: 768px) {
    .dvc-filter-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .dvc-filter-button {
        margin-left: 5px;
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Mobile Card Layout */
@media (max-width: 768px) {
    /* Hide tables on mobile */
    .resort-section table {
        display: none;
    }
    
    /* Show cards on mobile */
    .resort-section .mobile-cards {
        display: block;
    }
    
    /* Date controls mobile adjustments */
    .date-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .date-controls .date-picker-wrapper {
        width: 100%;
    }
    
    .date-controls .date-input {
        width: 100%;
    }
    
    .date-picker.inline {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-button-container {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
    
    .dvc-filter-button {
        width: 100%;
    }
}

/* Desktop: Hide cards, show tables */
@media (min-width: 769px) {
    .resort-section .mobile-cards {
        display: none;
    }
    
    .resort-section table {
        display: table;
    }
}

/* Mobile Cards Container */
.mobile-cards {
    display: none;
    padding: 15px;
}

/* Mobile Card - Room Type Group */
.mobile-room-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.mobile-room-card-header {
    background: #f5f5f5;
    padding: 12px 15px;
    font-weight: 600;
    font-size: 1.1em;
    color: #1a237e;
    border-bottom: 2px solid #e0e0e0;
}

/* Mobile Card - View Items */
.mobile-view-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mobile-view-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-view-item:last-child {
    border-bottom: none;
}

.mobile-view-item.no-points {
    background: #fafafa;
    color: #999;
}

.mobile-view-label {
    font-weight: 600;
    font-size: 0.95em;
    color: #333;
    margin-bottom: 4px;
}

.mobile-view-value {
    font-size: 1.1em;
    color: #1a237e;
    font-weight: 600;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    gap: 4px;
}

.mobile-view-value .points-value {
    color: #1a237e;
}

.mobile-view-value .price-value {
    color: #2e7d32;
    font-size: 1.05em;
}

.mobile-view-value .no-data {
    color: #999;
    font-weight: normal;
    font-style: italic;
}

/* Mobile card hover/tap states */
.mobile-view-item.has-points {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mobile-view-item.has-points:active {
    background-color: #f5f5f5;
}

/* Mobile: Improve spacing and readability */
@media (max-width: 768px) {
    .resort-section {
        margin-bottom: 20px;
    }
    
    .resort-header {
        padding: 10px 15px;
        font-size: 1.1em;
    }
    
    .dvc-point-calculator-full .controls {
        padding: 15px;
    }
    
    .dvc-point-calculator-full {
        gap: 15px;
        margin: 15px 0;
    }
}