/**
 * TSL Calendar Module Styles
 */

/* ===== INVENTORY ASSIGNMENT ===== */
.tsl-inventory-assignment {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.tsl-assignment-header {
    margin-bottom: 2rem;
}

.tsl-assignment-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.tsl-assignment-filters {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 8px;
    flex-wrap: wrap;
}

.tsl-filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tsl-filter-group label {
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

.tsl-filter-select,
.tsl-filter-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
}

.tsl-assignment-main {
    display: grid;
    grid-template-columns: 300px 1fr 350px;
    gap: 2rem;
}

.tsl-assignment-sidebar {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    max-height: 80vh;
    overflow-y: auto;
}

.tsl-assignment-sidebar h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
}

.tsl-bookings-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tsl-booking-item {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-left-width: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.tsl-booking-item:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.tsl-booking-item.selected {
    background: #eff6ff;
    border-color: #3b82f6;
}

.tsl-booking-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.tsl-booking-dates {
    font-size: 0.875rem;
    color: #6b7280;
}

.tsl-assignment-calendar {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
}

.tsl-assignment-panel {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    max-height: 80vh;
    overflow-y: auto;
}

.tsl-assignment-panel h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
}

.tsl-selected-booking {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 6px;
}

.tsl-no-selection {
    color: #6b7280;
    font-style: italic;
}

.tsl-assignment-form h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
}

.tsl-form-group {
    margin-bottom: 1.5rem;
}

.tsl-form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.tsl-form-group select,
.tsl-form-group input[type="date"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
}

.tsl-form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.tsl-btn-primary,
.tsl-btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.tsl-btn-primary {
    background: #3b82f6;
    color: white;
}

.tsl-btn-primary:hover {
    background: #2563eb;
}

.tsl-btn-secondary {
    background: #e5e7eb;
    color: #1f2937;
}

.tsl-btn-secondary:hover {
    background: #d1d5db;
}

/* ===== CALENDAR TABLE ===== */
.tsl-calendar-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tsl-calendar-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.875rem;
}

.tsl-calendar-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
}

.tsl-calendar-table th {
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: #374151;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    white-space: nowrap;
}

.tsl-calendar-row-header {
    text-align: left !important;
    min-width: 200px;
    position: sticky;
    left: 0;
    z-index: 5;
    background: #f9fafb;
}

.tsl-calendar-date-header {
    min-width: 80px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    height: 120px;
}

.tsl-calendar-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
}

.tsl-calendar-table tbody td {
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    text-align: center;
    vertical-align: middle;
    min-width: 80px;
    height: 60px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.tsl-calendar-table tbody td:hover {
    opacity: 0.8;
    transform: scale(1.02);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tsl-inventory-name-cell {
    position: sticky;
    left: 0;
    z-index: 3;
    background: white;
    font-weight: 500;
    text-align: left !important;
    padding-left: 1rem !important;
    min-width: 200px;
}

.tsl-calendar-cell {
    padding: 0.25rem;
}

.tsl-cell-booking-name {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0.25rem;
}

/* Category/Subcategory Headers */
.tsl-calendar-category-header td,
.tsl-calendar-subcategory-header td {
    background: #f3f4f6;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid #d1d5db;
}

.tsl-category-cell {
    text-align: left !important;
}

.tsl-subcategory-cell {
    text-align: left !important;
    padding-left: 2rem !important;
    font-style: italic;
    font-weight: 500;
}

.tsl-accordion-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tsl-toggle-icon {
    transition: transform 0.2s;
    display: inline-block;
}

.tsl-accordion-toggle.collapsed .tsl-toggle-icon {
    transform: rotate(-90deg);
}

/* View Mode Styles */
.tsl-calendar-table[data-view-mode="simplified"] .tsl-calendar-category-header,
.tsl-calendar-table[data-view-mode="simplified"] .tsl-calendar-subcategory-header {
    display: none;
}

.tsl-calendar-table[data-view-mode="simplified"] .tsl-calendar-inventory-row[data-category] {
    border-top: 3px solid #d1d5db;
}

.tsl-calendar-table[data-view-mode="standard"] .tsl-calendar-subcategory-header {
    display: none;
}

.tsl-calendar-table[data-view-mode="standard"] .tsl-calendar-inventory-row[data-category] {
    border-top: 2px solid #e5e7eb;
}

.tsl-calendar-table[data-view-mode="detailed"] .tsl-calendar-inventory-row[data-category] {
    border-top: 1px solid #e5e7eb;
}

/* Collapsed rows */
.tsl-calendar-table tbody tr.collapsed {
    display: none;
}

/* ===== SEASON CALENDAR ===== */
.tsl-season-calendar {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Filter Bar - Full Width at Top */
.tsl-calendar-filter-bar {
    width: 100%;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    padding: 1rem 2rem;
    margin-bottom: 0;
}

.tsl-filter-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.tsl-filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tsl-filter-group label {
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    font-size: 0.875rem;
}

.tsl-filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    min-width: 120px;
}

.tsl-filter-actions {
    margin-left: auto;
}

/* Calendar Main - Full Width */
.tsl-calendar-main {
    width: 100%;
    padding: 2rem;
    background: white;
}

.tsl-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.tsl-calendar-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
}

.tsl-calendar-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.tsl-calendar-nav {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.tsl-calendar-nav:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.tsl-year-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

.tsl-calendar-view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tsl-view-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.tsl-view-btn:hover {
    background: #f9fafb;
}

.tsl-view-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.tsl-calendar-legend {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 8px;
}

.tsl-calendar-legend h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
}

.tsl-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.tsl-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-left-width: 4px;
    border-radius: 6px;
}

.tsl-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.tsl-legend-label {
    font-size: 0.875rem;
    color: #374151;
}

.tsl-season-months {
    display: grid;
    gap: 3rem;
}

.tsl-season-month {
    margin-bottom: 3rem;
}

.tsl-season-month h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
}

/* ===== GUEST CALENDAR ===== */
.tsl-guest-calendar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.tsl-guest-header {
    margin-bottom: 2rem;
}

.tsl-guest-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.tsl-booking-dates {
    font-size: 1rem;
    color: #6b7280;
}

.tsl-assigned-inventory {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 8px;
}

.tsl-assigned-inventory h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
}

.tsl-inventory-list {
    display: grid;
    gap: 1rem;
}

.tsl-inventory-item {
    padding: 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.tsl-inventory-item h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.tsl-assigned-dates {
    font-size: 0.875rem;
    color: #6b7280;
}

.tsl-calendar-view {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
}

/* Booking Search Suggestions */
.tsl-suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.tsl-suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

.tsl-suggestion-item:hover {
    background: #f9fafb;
}

.tsl-suggestion-item:last-child {
    border-bottom: none;
}

/* Inventory Assignment Form Styles */
.tsl-inventory-assignment-booking {
    padding: 20px;
    max-width: 100%;
}

.tsl-assignment-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.tsl-booking-info {
    margin-top: 20px;
}

.tsl-info-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.tsl-info-row strong {
    min-width: 150px;
}

.tsl-assignment-content {
    margin: 30px 0;
}

.tsl-assignment-section {
    margin-bottom: 40px;
}

.tsl-boat-type-section,
.tsl-room-type-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.tsl-type-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #d1d5db;
}

.tsl-type-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.tsl-type-count-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tsl-type-count-input label {
    font-weight: 600;
    margin: 0;
}

.tsl-type-count {
    width: 80px;
    padding: 5px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}

.tsl-assignment-table-wrapper {
    overflow-x: auto;
    margin-top: 15px;
}

.tsl-assignment-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.tsl-assignment-table th {
    padding: 10px;
    text-align: center;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    font-weight: 600;
    font-size: 0.875rem;
}

.tsl-assignment-table td {
    padding: 8px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.tsl-assignment-table .tsl-inventory-name {
    text-align: left;
    font-weight: 500;
    padding-left: 15px;
}

.tsl-assignment-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.tsl-inventory-row.assigned {
    background-color: #eff6ff;
}

.tsl-assignment-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e5e7eb;
    display: flex;
    gap: 10px;
}

.tsl-cell-offline {
    background-color: #9ca3af !important;
    color: #ffffff !important;
    cursor: not-allowed;
}

.tsl-cell-offline-label {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Guest Calendar Styles */
.tsl-guest-calendar {
    padding: 20px;
}

.tsl-guest-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.tsl-booking-dates {
    color: #6b7280;
    margin-top: 10px;
}

.tsl-assigned-inventory {
    margin-bottom: 30px;
}

.tsl-inventory-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.tsl-inventory-item {
    padding: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.tsl-inventory-item h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
}

.tsl-assigned-dates {
    color: #6b7280;
    font-size: 0.875rem;
}

.tsl-guest-calendar-table .tsl-cell-guest-name {
    font-weight: 600;
    font-size: 0.875rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .tsl-assignment-main {
        grid-template-columns: 1fr;
    }
    
    .tsl-assignment-sidebar,
    .tsl-assignment-panel {
        max-height: none;
    }
    
    .tsl-calendar-table {
        font-size: 0.75rem;
    }
    
    .tsl-calendar-table th,
    .tsl-calendar-table td {
        padding: 0.25rem;
        min-width: 60px;
    }
    
    .tsl-inventory-name-cell {
        min-width: 150px;
    }
}

@media (max-width: 768px) {
    .tsl-inventory-assignment,
    .tsl-season-calendar,
    .tsl-guest-calendar {
        padding: 1rem;
    }
    
    .tsl-calendar-days {
        gap: 0.25rem;
    }
    
    .tsl-calendar-cell {
        min-height: 80px;
        padding: 0.25rem;
    }
    
    .tsl-assignment-filters {
        flex-direction: column;
    }
    
    .tsl-filter-group {
        flex-direction: column;
        align-items: flex-start;
    }
}

