/* Ski Resort Compare Styles */

/* Compare Button */
.ski-resort-compare-wrapper {
    margin: 20px 0;
    text-align: center;
}

.ski-resort-compare-btn {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ski-resort-compare-btn:hover {
    background: #34495e;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.ski-resort-compare-btn.added {
    background: #27ae60;
}

.ski-resort-compare-btn.added:hover {
    background: #2ecc71;
}

.ski-resort-compare-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Compare Bar */
.compare-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: #34495e !important;
    color: white !important;
    padding: 15px 20px !important;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15) !important;
    z-index: 999999 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
}

.compare-bar:hover {
    background: #2c3e50;
}

.compare-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.compare-resorts-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.compare-count {
    font-size: 16px;
    font-weight: 500;
}

.compare-resorts-names {
    font-size: 14px;
    opacity: 0.9;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.resort-name-item {
    background: rgba(255,255,255,0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.resort-name-item:hover {
    background: rgba(255,255,255,0.2);
}

.resort-name-link {
    color: white;
    text-decoration: none;
    font-size: 13px;
}

.resort-name-link:hover {
    color: white;
    text-decoration: underline;
}

.resort-remove-btn {
    background: none;
    border: none;
    color: white;
    font-size: 12px;
    cursor: pointer;
    opacity: 0.7;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.resort-remove-btn:hover {
    opacity: 1;
    background: rgba(255,255,255,0.2);
}

.vs-separator {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    font-weight: bold;
}

.view-comparison-btn,
.clear-comparison-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-comparison-btn:hover {
    background: #2980b9;
}

.view-comparison-btn:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
}

.clear-comparison-btn {
    background: #e74c3c;
}

.clear-comparison-btn:hover {
    background: #c0392b;
}

/* Modal */
.compare-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.compare-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 95vw;
    max-height: 90vh;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.compare-modal-header {
    background: #2c3e50;
    color: white;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.compare-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.close-modal:hover {
    background: rgba(255,255,255,0.1);
}

.compare-modal-body {
    padding: 0;
    overflow: auto;
    max-height: calc(90vh - 80px);
}

/* Comparison Table */
.comparison-table-container {
    position: relative;
    overflow: hidden;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
}

.comparison-table-container::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(to left, rgba(255,255,255,0.9), transparent);
    pointer-events: none;
    z-index: 12;
}

.scroll-indicator {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    background: rgba(52, 73, 94, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 13;
    pointer-events: none;
    opacity: 0.7;
    animation: fadeInOut 3s infinite;
}

/* Scroll Navigation Arrows */
.scroll-nav-arrows {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 14;
    display: flex;
    gap: 5px;
}

.scroll-nav-left {
    left: 210px; /* Position after fixed column */
}

.scroll-nav-right {
    right: 30px;
}

.scroll-arrow {
    background: rgba(52, 73, 94, 0.9);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.scroll-arrow:hover {
    background: rgba(52, 73, 94, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.scroll-arrow:active {
    transform: scale(0.95);
}

.scroll-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.scroll-arrow:disabled:hover {
    transform: none;
    background: rgba(52, 73, 94, 0.9);
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Mobile responsiveness for horizontal scroll */
@media (max-width: 768px) {
    .table-scroll-wrapper {
        scrollbar-width: auto;
    }
    
    .table-scroll-wrapper::-webkit-scrollbar {
        height: 8px;
    }
    
    .ski-resort-comparison-table th,
    .ski-resort-comparison-table td {
        min-width: 120px;
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .ski-resort-comparison-table td:first-child,
    .ski-resort-comparison-table th:first-child {
        min-width: 150px;
        max-width: 150px;
    }
    
    .scroll-indicator {
        font-size: 11px;
        padding: 3px 6px;
        right: 5px;
    }
    
    .scroll-nav-left {
        left: 160px; /* Adjust for smaller fixed column */
    }
    
    .scroll-arrow {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .ski-resort-comparison-table th,
    .ski-resort-comparison-table td {
        min-width: 100px;
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .ski-resort-comparison-table td:first-child,
    .ski-resort-comparison-table th:first-child {
        min-width: 120px;
        max-width: 120px;
    }
    
    .scroll-nav-left {
        left: 130px; /* Adjust for mobile fixed column */
    }
    
    .scroll-arrow {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

.table-scroll-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
    max-height: 80vh;
    background: white;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

.table-scroll-wrapper::-webkit-scrollbar {
    height: 12px;
}

.table-scroll-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 6px;
    border: 2px solid #f1f1f1;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.ski-resort-comparison-table {
    width: auto;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    line-height: 1.4;
    background: white;
}

.table-fixed-column {
    position: sticky;
    left: 0;
    z-index: 10;
    background: white;
    box-shadow: 2px 0 8px rgba(0,0,0,0.15);
    border-right: 2px solid #dee2e6 !important;
}

.ski-resort-comparison-table th {
    background: #ecf0f1;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #bdc3c7;
    border-right: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 5;
    white-space: nowrap;
    min-width: 160px;
}

.ski-resort-comparison-table th:first-child {
    background: #d5dbdb !important;
    font-weight: 700;
    z-index: 15 !important;
    min-width: 200px;
    max-width: 200px;
    box-shadow: 2px 0 8px rgba(0,0,0,0.15);
}

.ski-resort-comparison-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #ecf0f1;
    border-right: 1px solid #eee;
    vertical-align: middle;
    white-space: nowrap;
    min-width: 160px;
    background: white;
}

.ski-resort-comparison-table td:first-child {
    background: #f8f9fa !important;
    font-weight: 500;
    position: sticky;
    left: 0;
    z-index: 8;
    min-width: 200px;
    max-width: 200px;
    box-shadow: 2px 0 8px rgba(0,0,0,0.15);
    border-right: 2px solid #dee2e6;
}

.ski-resort-comparison-table .best-value {
    background: #d4edda !important;
    font-weight: 600;
    color: #155724;
    position: relative;
}

.remove-resort-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.remove-resort-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* Loading and Error States */
.loading-spinner {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #7f8c8d;
}

.loading-spinner::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ecf0f1;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    text-align: center;
    padding: 40px;
    color: #e74c3c;
    font-size: 16px;
}

/* Body class when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
    .compare-bar-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .compare-resorts-names {
        font-size: 12px;
    }
    
    .resort-name-item {
        padding: 3px 6px;
    }
    
    .resort-name-link {
        font-size: 12px;
    }
    
    .table-scroll-wrapper {
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .compare-modal-content {
        margin: 10px;
    }
    
    .compare-modal-header {
        padding: 15px 20px;
    }
    
    .compare-modal-header h2 {
        font-size: 20px;
    }
    
    .ski-resort-comparison-table {
        font-size: 12px;
    }
    
    .ski-resort-comparison-table th,
    .ski-resort-comparison-table td {
        padding: 8px 6px;
    }
    
    .ski-resort-comparison-table th:first-child {
        min-width: 140px;
    }
}

@media (max-width: 480px) {
    .compare-modal {
        padding: 10px;
    }
    
    .ski-resort-comparison-table {
        font-size: 11px;
    }
    
    .ski-resort-comparison-table th,
    .ski-resort-comparison-table td {
        padding: 6px 4px;
    }
}

/* Table scroll styling */
.compare-modal-body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.compare-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.compare-modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.compare-modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
} 