* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 20px;
    margin-bottom: 0;
    border-radius: 0;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin-bottom: 10px;
    font-size: 1.5em;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: #34495e;
}

/* Canvas layer popup styling - ensure popups appear above canvas */
.track-popup .leaflet-popup-content-wrapper {
    z-index: 10000 !important;
}

.track-popup .leaflet-popup-tip {
    z-index: 10000 !important;
}

.leaflet-popup-pane {
    z-index: 10000 !important;
}

.track-canvas-layer {
    z-index: 200 !important;
    cursor: grab;
}

.track-canvas-layer:active {
    cursor: grabbing;
}

.leaflet-popup {
    z-index: 10000 !important;
}

/* Map container cursor styling */
#map {
    cursor: grab;
}

#map:active {
    cursor: grabbing;
}

.leaflet-container {
    cursor: grab !important;
}

.leaflet-container:active {
    cursor: grabbing !important;
}

.leaflet-dragging .leaflet-container {
    cursor: grabbing !important;
}

.auth-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.section {
    display: none;
    flex: 1;
    background-color: white;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    min-height: 0;
}

.section.active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Sidebar Resizer Styles */
.sidebar-resizer {
    position: absolute;
    top: 0;
    left: 350px;
    width: 10px;
    height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ew-resize !important;
    z-index: 1000;
    background: transparent;
}

.resizer-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 80px;
    background: #888;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    user-select: none;
    cursor: ew-resize;
    z-index: 9999;
}

.resizer-icon {
    font-size: 16px;
    color: #666;
    font-weight: normal;
    user-select: none;
    pointer-events: none;
}

.sidebar-resizer:hover .resizer-handle {
    background: #007bff;
    width: 6px;
    transform: translate(-50%, -50%);
}

.sidebar-resizer.dragging .resizer-handle {
    background: #0056b3;
    width: 8px;
    transform: translate(-50%, -50%);
}

/* Hide resizer when sidebar is collapsed */
.map-container.sidebar-collapsed .sidebar-resizer {
    display: none;
}

.map-container {
    display: flex;
    height: 100%;
    width: 100%;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
    min-height: 0;
    max-height: none;
    margin-left: 350px;
}

/* When sidebar is collapsed, expand map to full width */
.map-container.sidebar-collapsed #map {
    margin-left: 0;
}

.map-sidebar {
    position: absolute;
    left: 0;
    top: 0;
    width: 350px;
    min-width: 250px;
    max-width: 600px;
    height: calc(100% - 5px);
    background: white;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
    flex-shrink: 0;
}

.map-sidebar .search-form-container {
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.map-sidebar .search-form-container h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
}

.map-sidebar .search-form .form-group {
    margin-bottom: 10px;
}

.map-sidebar .search-form .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.85em;
}

.map-sidebar .search-form .form-group input,
.map-sidebar .search-form .form-group select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85em;
    box-sizing: border-box;
}

.map-sidebar .search-btn {
    width: 100%;
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s;
}

.map-sidebar .search-btn:hover {
    background: #2980b9;
}

.map-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    min-height: 0;
}

.map-search-results .table-card {
    margin-bottom: 8px;
    padding: 15px;
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 4px solid #3498db;
}

.map-search-results .table-card .card-left {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.map-search-results .table-card .card-right {
    flex-shrink: 0;
    margin-left: 15px;
}

.map-search-results .table-header {
    margin-bottom: 5px;
    align-items: center;
    display: flex;
}

.map-search-results .table-header h3 {
    font-size: 0.9em;
    margin: 0;
    color: #2c3e50;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.map-search-results .table-description {
    font-size: 0.8em;
    margin: 0;
    color: #666;
    line-height: 1.4;
}

.map-search-results .view-table-btn {
    padding: 8px 16px;
    font-size: 0.85em;
    margin: 0;
    white-space: nowrap;
}

.search-bar {
    margin: 15px;
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-bar button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.search-bar button:hover {
    background-color: #2980b9;
}

table {
    width: 100%;
    border-collapse: collapse;
    flex: 1;
    overflow-y: auto;
}

.table-container {
    flex: 1;
    overflow-y: auto;
    margin: 0 15px 15px 15px;
}

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

table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

table tr:hover {
    background-color: #f8f9fa;
}

.form-group {
    margin-bottom: 15px;
}

.form-container {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
}

button[type="submit"] {
    background-color: #27ae60;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

button[type="submit"]:hover {
    background-color: #229954;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-edit,
.btn-delete {
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.btn-edit {
    background-color: #f39c12;
    color: white;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
}

.btn-edit:hover {
    background-color: #e67e22;
}

.btn-delete:hover {
    background-color: #c0392b;
}

.catalog-container {
    flex: 1;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    width: 100%;
}

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

.catalog-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.catalog-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.catalog-item.selected {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.catalog-item h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.2em;
}

.catalog-item .item-id {
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    display: inline-block;
    margin-bottom: 10px;
}

.catalog-item .item-details {
    margin: 10px 0;
}

.catalog-item .item-details span {
    display: block;
    margin: 5px 0;
    color: #555;
    font-size: 0.9em;
}

.catalog-item .item-details strong {
    color: #2c3e50;
}

.catalog-item .view-on-map {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.catalog-item .view-on-map:hover {
    background-color: #2980b9;
}

/* Main Catalog Styles */
.main-catalog-grid {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.main-catalog-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.main-catalog-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.main-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.main-catalog-item h2 {
    margin: 0 0 20px 0;
    font-size: 2em;
    font-weight: 300;
}

.main-stats {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.8;
}

.main-description {
    margin: 20px 0 30px 0;
    opacity: 0.9;
    line-height: 1.5;
}

.explore-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.explore-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

/* Tables Grid Styles */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 25px;
    padding: 20px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    justify-items: stretch;
}

.table-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

.table-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #3498db;
}

.table-card.empty-table {
    opacity: 0.6;
    cursor: not-allowed;
}

.table-card.empty-table:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #e0e0e0;
}

.table-header {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    margin-bottom: 10px;
}

.table-icon {
    font-size: 1.1em;
    margin-right: 8px;
    margin-top: 0px;
    color: #3498db;
    flex-shrink: 0;
}

.table-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
    flex: 1;
}

.table-info {
    flex: 1;
    margin-bottom: 12px;
    text-align: left;
}

.table-description {
    color: #555;
    font-size: 0.95em;
    line-height: 1.5;
    margin-left: 22px;
    margin-top: 8px;
}

.date-range {
    white-space: nowrap;
    display: inline-block;
}



.table-empty {
    color: #999;
    font-style: italic;
    font-size: 0.7em;
    margin-left: 20px;
}


.view-table-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.0em;
    font-weight: 500;
    transition: background-color 0.3s;
    width: 100%;
    margin-top: auto;
}

.view-table-btn:hover:not(:disabled) {
    background: #2980b9;
}

.view-table-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* Header Back Button Styles */
.search-bar h2 button {
    background: none !important;
    border: none !important;
    color: #2c3e50 !important;
    cursor: pointer !important;
    font-size: 16px !important;
    margin-right: 10px !important;
    padding: 5px 10px !important;
    border-radius: 4px !important;
    transition: background-color 0.3s !important;
}

.search-bar h2 button:hover {
    background-color: #ecf0f1 !important;
}

/* Search Form Styles */
.search-form-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-form .form-row {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.search-form .form-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.search-form .form-group label {
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9em;
}

.search-form .form-group input,
.search-form .form-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
}

.search-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s;
    height: fit-content;
}

/* Search buttons inside search-buttons container should have consistent height */
.search-buttons .search-btn {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
}

.search-btn:hover {
    background: #2980b9;
}

.search-results {
    min-height: 200px;
}

.results-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.results-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
}

.error-message {
    text-align: center;
    padding: 40px;
    color: #e74c3c;
    background: #fdf2f2;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

/* Checkbox and Controls Styles */
.table-checkbox {
    margin-right: 10px;
    flex-shrink: 0;
}

.table-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.results-controls {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.show-selected-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s;
}

.show-selected-btn:hover:not(:disabled) {
    background: #229954;
}

.show-selected-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.select-all-btn, .clear-all-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: background-color 0.3s;
}

.select-all-btn:hover, .clear-all-btn:hover {
    background: #2980b9;
}

.clear-all-btn {
    background: #95a5a6;
}

.clear-all-btn:hover {
    background: #7f8c8d;
}

/* Attribute Section Styles */
.attribute-section {
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    padding: 15px;
    flex-shrink: 0;
}

.attribute-section h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.0em;
    font-weight: 600;
}

.attribute-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attribute-controls .form-group {
    margin-bottom: 0;
}

.attribute-controls .form-group label {
    display: block;
    margin-bottom: 3px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.8em;
}

.attribute-controls .form-group select {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.8em;
    box-sizing: border-box;
}

/* Map sidebar controls */
.map-results-controls {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.map-results-list .table-card {
    margin-bottom: 8px;
    padding: 10px;
}

.map-results-list .table-header {
    align-items: center;
    margin-bottom: 5px;
}

.map-results-list .table-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Chart Modal Styles */
.chart-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.chart-modal-content {
    background-color: #fefefe;
    margin: 2% auto;
    padding: 0;
    border: none;
    width: 90%;
    max-width: 1000px;
    max-height: 95vh;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.chart-modal-header {
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-modal-header h3 {
    margin: 0;
    font-size: 1.2em;
}

.chart-modal-close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.chart-modal-close:hover {
    opacity: 0.7;
}

.chart-modal-body {
    padding: 20px;
    background: white;
    border-radius: 0 0 8px 8px;
    overflow-x: hidden;
}

#chartCanvas {
    max-width: 100%;
    min-height: 600px;
    height: auto;
    overflow: hidden;
}

/* Chart Loading Progress Bar */
.chart-loading {
    display: none;
    text-align: center;
    padding: 40px;
    background: white;
}

.chart-loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

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

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

@keyframes smoothBlink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

.chart-loading-text {
    color: #2c3e50;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
}

.chart-loading-subtext {
    color: #7f8c8d;
    font-size: 14px;
}

/* Chart Tooltip */
.chart-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 10000;
    white-space: nowrap;
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chart-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
}

/* Status Bar */
.status-bar {
    background: #2c3e50;
    padding: 8px 15px;
    width: 100%;
    box-sizing: border-box;
    border-top: 1px solid #34495e;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-bar p {
    margin: 0;
    font-size: 0.9em;
    color: #bdc3c7;
}

.status-bar .created-by {
    font-size: 0.8em;
    color: #95a5a6;
}

/* Auth Button Styles */
.auth-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 8px;
    transition: background-color 0.3s;
}

.auth-btn:hover {
    background: #2980b9;
}

/* Auth Modal Styles */
.auth-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.auth-modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 0;
    border: none;
    width: 90%;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.auth-modal-header {
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-modal-header h3 {
    margin: 0;
    font-size: 1.2em;
}

.auth-modal-close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.auth-modal-close:hover {
    opacity: 0.7;
}

.auth-modal-body {
    padding: 20px;
    background: white;
    border-radius: 0 0 8px 8px;
}

.auth-submit-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.0em;
    width: 100%;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.auth-submit-btn:hover {
    background: #229954;
}

/* Tab Styles */
.tab-container {
    margin-bottom: 15px;
}

.tab-buttons {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 15px;
}

.tab-btn {
    flex: 1;
    padding: 10px 15px;
    background: #f8f9fa;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: #e9ecef;
}

.tab-btn.active {
    background: white;
    border-bottom-color: #3498db;
    color: #3498db;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Track Search Specific Styles */
.date-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-range input {
    flex: 1;
}

.date-range span {
    color: #666;
    font-weight: 500;
}

.filter-section, .spatial-filter-section {
    background: #f8f9fa;
    padding: 5px;
    border-radius: 6px;
    margin-bottom: 5px;
    border-left: 4px solid #3498db;
}

.filter-section:first-child {
    margin-top: 0;
}

.filter-section h4, .spatial-filter-section h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 0.95em;
    font-weight: 600;
}

.inline-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.inline-controls label {
    margin: 0;
    font-size: 0.8em;
    color: #555;
}

.inline-controls select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.8em;
}

.spatial-inputs {
    margin-top: 10px;
}

.coordinate-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.coordinate-inputs label {
    min-width: 40px;
    font-size: 0.8em;
    color: #555;
}

.coordinate-inputs input {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.8em;
}

.coordinate-inputs span {
    color: #666;
}

.map-selection {
    margin-top: 10px;
}

.map-select-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: background-color 0.3s;
}

.map-select-btn:hover {
    background: #229954;
}

.track-search-btn {
    background: #e67e22;
    font-size: 1.0em;
    font-weight: 600;
    padding: 12px 20px;
}

.track-search-btn:hover {
    background: #d35400;
}

/* Map area selection inline style */
.form-group.inline-form-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.form-group.inline-form-group label {
    display: block;
    margin-bottom: 0;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: left;
}

.form-group.inline-form-group select {
    width: 180px;
    flex-shrink: 0;
}

/* Autocomplete styles */
.form-group {
    position: relative;
}

.autocomplete-items {
    position: absolute;
    border: 1px solid #d4d4d4;
    border-bottom: none;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    background-color: #fff;
    border-bottom: 1px solid #d4d4d4;
    font-size: 0.85em;
}

.autocomplete-items div:hover {
    background-color: #e9e9e9;
}

.autocomplete-active {
    background-color: DodgerBlue !important;
    color: #ffffff;
}

/* Collapsible sections */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.collapsible-header h4 {
    margin: 0;
}

.collapse-icon {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.collapsible-header.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.collapsible-content {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 15px;
    padding-top: 10px;
}

.collapsible-content.collapsed {
    max-height: 0;
    padding-left: 15px;
}

.tab-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Track buttons */
.track-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.track-buttons .view-table-btn {
    flex: 1;
    font-size: 0.85em;
    padding: 8px 12px;
}

.animation-btn {
    background: #E67E22 !important;
}

.animation-btn:hover {
    background: #D35400 !important;
}

/* Ship marker styles with performance optimizations */
.ship-marker {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    will-change: transform;
    transform-origin: center center;
    transition: none;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
}

.track-marker {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    font-size: 16px;
}

/* Static ship markers for actual data points with optimization */
.static-ship {
    background: transparent;
    border: none;
    border-radius: 0;
    will-change: auto;
    transform-origin: center center;
    backface-visibility: hidden;
    box-shadow: none;
    opacity: 0.8;
    z-index: 500;
}

/* Timeline styles */
.timeline-container {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.timeline-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9em;
}

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

.timeline-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: background-color 0.3s;
}

.timeline-btn:hover {
    background: #2980b9;
}

.timeline-btn.pause-btn {
    background: #f39c12;
}

.timeline-btn.pause-btn:hover {
    background: #e67e22;
}

.timeline-btn.stop-btn {
    background: #e74c3c;
}

.timeline-btn.stop-btn:hover {
    background: #c0392b;
}

.timeline-progress {
    margin-top: 10px;
}

.timeline-bar {
    position: relative;
    width: 100%;
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
}

.timeline-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #3498db;
    border-radius: 4px;
    transition: width 0.1s ease;
    width: 0%;
}

.timeline-thumb {
    position: absolute;
    top: -4px;
    left: 0;
    width: 16px;
    height: 16px;
    background: #2980b9;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transform: translateX(-50%);
    transition: left 0.1s ease;
}

.timeline-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #7f8c8d;
    font-family: monospace;
}

/* Separate result areas for different tabs */
.observation-results {
    display: block;
}

.track-results {
    display: none;
}

/* Ensure proper styling for both result areas */
.map-search-results.observation-results,
.map-search-results.track-results {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    max-height: 600px;
    min-height: 200px;
}

/* Tab wrapper styling to ensure proper scrolling */
.tab-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    flex: 1;
}

.tab-wrapper .map-search-results {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
    min-height: 200px;
}

/* Modern Observation Wrapper Design */
#observation-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: white;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid #e8f4f8;
}

/* Clean Search Form Container */
#observation-wrapper .search-form {
    flex: 0 0 35%;
    overflow-y: hidden;
    background: #f8f9fa;
    margin: 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

#observation-wrapper .search-form.collapsed {
    flex: 0 0 60px;
    height: 60px;
    overflow: hidden;
}

#observation-wrapper .search-form.fixed-height {
    flex: none;
}

#observation-wrapper .search-form.fixed-height.collapsed {
    flex: 0 0 60px;
    height: 60px !important;
}

/* Track wrapper styles - same as observation wrapper */
#track-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid #e8f4f8;
}

/* Clean Search Form Container for Track */
#track-wrapper .search-form {
    flex: 0 0 35%;
    overflow-y: hidden;
    background: #f8f9fa;
    margin: 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

#track-wrapper .search-form.collapsed {
    flex: 0 0 60px;
    height: 60px;
    overflow: hidden;
}

#track-wrapper .search-form.fixed-height {
    flex: none;
}

#track-wrapper .search-form.fixed-height.collapsed {
    flex: 0 0 60px;
    height: 60px !important;
}

/* Track search form header - same as observation */
#track-wrapper .search-form-header {
    position: relative;
    background: #e9ecef;
    color: #495057;
    padding: 12px 16px;
    height: 50px;
    box-sizing: border-box;
    border-radius: 6px 6px 0 0;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
}

#track-wrapper .search-form-header:hover {
    background: #dee2e6;
}

#track-wrapper .search-form-toggle {
    display: block;
}

/* Ultra compact filter sections for track */
#track-wrapper .filter-section {
    margin-bottom: 0px;
    border-radius: 5px;
    padding: 5px;
    min-height: 120px;
}

#track-wrapper .spatial-filter-section {
    margin-top: 0px;
    margin-bottom: 0px;
    border-radius: 5px;
    padding: 5px;
    min-height: 80px;
}

#track-wrapper .form-group label {
    font-size: 0.7em;
    font-weight: 500;
    color: #495057;
    margin-bottom: 2px;
    display: block;
}

#track-wrapper .form-control,
#track-wrapper select,
#track-wrapper input[type="date"] {
    font-size: 0.7em;
    padding: 4px 6px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    line-height: 1.4;
    min-height: 24px;
}

#track-wrapper input[type="date"]:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Track attribute section */
#track-wrapper .attribute-section {
    flex: 0 0 auto;
    min-height: 160px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 12px;
    overflow-y: auto;
}

/* Track search results */
#track-wrapper .map-search-results {
    flex: 1;
    overflow-y: auto;
    background: white;
    border-top: 1px solid #dee2e6;
    padding: 12px;
}

/* Ultra Compact Collapsible Headers for Track */
#track-wrapper .collapsible-header {
    background: #ffffff;
    color: #495057;
    padding: 3px 5px;
    border-radius: 1px;
    margin: 1px 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-weight: 500;
    font-size: 0.7em;
    border: 1px solid #dee2e6;
}

#track-wrapper .collapsible-header:hover {
    background: #f8f9fa;
}

#track-wrapper .collapsible-header.collapsed {
    background: #f8f9fa;
    color: #6c757d;
}

#track-wrapper .collapsible-header h4 {
    margin: 0;
    font-size: 0.7em;
    font-weight: 500;
    line-height: 1.2;
}

/* Ultra Compact Form Content for Track */
#track-wrapper .collapsible-content {
    padding: 3px 5px;
    background: white;
}

/* Simple search form toggle */
.search-form-toggle {
    display: none;
    position: absolute;
    top: 12px;
    right: 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease;
    z-index: 10;
}

#observation-wrapper .search-form-toggle {
    display: block;
}

.search-form-toggle:hover {
    background: #5a6268;
}

/* Simple search form header */
.search-form-header {
    position: relative;
    background: #e9ecef;
    color: #495057;
    padding: 12px 16px;
    height: 50px;
    box-sizing: border-box;
    border-radius: 6px 6px 0 0;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
}

.search-form-header:hover {
    background: #dee2e6;
}

/* Ultra Compact Collapsible Headers */
#observation-wrapper .collapsible-header {
    background: #ffffff;
    color: #495057;
    padding: 3px 5px;
    border-radius: 1px;
    margin: 1px 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-weight: 500;
    font-size: 0.7em;
    border: 1px solid #dee2e6;
}

#observation-wrapper .collapsible-header:hover {
    background: #f8f9fa;
}

#observation-wrapper .collapsible-header.collapsed {
    background: #f8f9fa;
    color: #6c757d;
}

#observation-wrapper .collapsible-header h4 {
    margin: 0;
    font-size: 0.7em;
    font-weight: 500;
    line-height: 1.2;
}

/* Ultra Compact Form Content */
#observation-wrapper .collapsible-content {
    padding: 3px 5px;
    background: white;
    margin: 0 4px 1px 4px;
    border-radius: 1px;
    border: 1px solid #dee2e6;
}

#observation-wrapper .form-group {
    margin-bottom: 3px;
}

/* Ultra compact filter sections */
#observation-wrapper .filter-section {
    margin-bottom: 0px;
    border-radius: 5px;
    padding: 5px;
    min-height: 120px;
}

#observation-wrapper .spatial-filter-section {
    margin-top: 0px;
    margin-bottom: 0px;
    border-radius: 5px;
    padding: 5px;
    min-height: 80px;
}

#observation-wrapper .form-group label {
    font-size: 0.7em;
    font-weight: 500;
    color: #495057;
    margin-bottom: 2px;
    display: block;
}

#observation-wrapper .form-control,
#observation-wrapper select,
#observation-wrapper input[type="date"] {
    font-size: 0.7em;
    padding: 4px 6px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    transition: border-color 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    height: 28px;
}

#observation-wrapper .form-control:focus,
#observation-wrapper select:focus,
#observation-wrapper input[type="date"]:focus {
    border-color: #80bdff;
    outline: none;
}

/* Compact date range */
#observation-wrapper .date-range {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
}

#observation-wrapper .date-range span {
    font-size: 0.7em;
    color: #6c757d;
}

/* Compact collapse icons */
#observation-wrapper .collapse-icon {
    font-size: 0.7em;
}

/* Ultra Compact Search Buttons */
#observation-wrapper .search-buttons {
    padding: 3px 5px;
    display: flex;
    gap: 3px;
    background: white;
    margin: 0 4px 1px 4px;
    border-radius: 2px;
    border-top: 1px solid #dee2e6;
}

#observation-wrapper .search-buttons button {
    font-size: 0.7em;
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    flex: 1;
    height: 28px;
}

#observation-wrapper .search-btn {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

#observation-wrapper .search-btn:hover {
    background: #0056b3;
    border-color: #004085;
}

#observation-wrapper .clear-all-btn {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

#observation-wrapper .clear-all-btn:hover {
    background: #545b62;
    border-color: #4e555b;
}

/* Clean Attribute Section */
#observation-wrapper .attribute-section {
    flex: 0 0 auto;
    min-height: 160px;
    overflow-y: hidden;
    background: #f8f9fa;
    margin: 0 12px 12px 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    padding: 12px;
    transition: all 0.3s ease;
}

#observation-wrapper .attribute-section h4 {
    color: #495057;
    font-size: 0.9em;
    margin-bottom: 8px;
    font-weight: 600;
}

/* Clean Results Container */
#observation-wrapper .map-search-results {
    flex: 1;
    height: calc(30% - 0px);
    overflow-y: auto;
    background: white;
    margin: 0 12px 12px 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    padding: 0;
    transition: all 0.3s ease;
}

/* Clean Result Cards */
#observation-wrapper .table-card {
    margin: 0;
    padding: 12px;
    border-bottom: 1px solid #f1f3f4;
    border-left: none;
    border-radius: 0;
    background: transparent;
    transition: background-color 0.2s ease;
}

#observation-wrapper .table-card:first-child {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

#observation-wrapper .table-card:last-child {
    border-bottom: none;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

#observation-wrapper .table-card:hover {
    background: #f8f9fa;
}

#observation-wrapper .no-results {
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    background: transparent;
}

/* Search results header styling */
.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    padding: 5px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.search-results-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.search-results-list {
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

/* Individual result item styling */
.result-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 12px;
    transition: box-shadow 0.2s ease;
}

.result-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.result-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

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

.result-header h5 {
    margin: 0;
    color: #2c3e50;
    font-size: 1em;
    font-weight: 600;
}

.result-details {
    margin: 8px 0;
    padding-left: 22px;
}

.result-details p {
    margin: 4px 0;
    font-size: 0.9em;
    color: #5a6c7d;
}

.result-actions {
    display: flex;
    gap: 8px;
    padding-left: 22px;
    margin-top: 10px;
}

/* Map search actions */
.map-search-actions {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.selected-count {
    font-size: 0.9em;
    color: #5a6c7d;
    margin-bottom: 8px;
}

.show-selected-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.show-selected-btn:hover {
    background: #219a52;
}

/* Track search results styling */
.track-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.track-results-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.ship-list {
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

.ship-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 12px;
    transition: box-shadow 0.2s ease;
}

.ship-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ship-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ship-checkbox {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
}

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

.ship-info {
    font-size: 0.9em;
    color: #5a6c7d;
}

.ship-details {
    margin: 8px 0;
    padding-left: 22px;
}

.ship-details p {
    margin: 4px 0;
    font-size: 0.9em;
    color: #5a6c7d;
}

.ship-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.view-btn, .animation-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.view-btn {
    background: #3498db;
    color: white;
}

.view-btn:hover {
    background: #2980b9;
}

.animation-btn {
    background: #e74c3c;
    color: white;
}

.animation-btn:hover {
    background: #c0392b;
}

/* Track actions styling */
.track-actions {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.stop-all-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.stop-all-btn:hover {
    background: #c0392b;
}

/* Timeline container styling */
.timeline-container {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.timeline-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.timeline-ship-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9em;
}

.timeline-status {
    font-size: 0.8em;
    color: #5a6c7d;
}

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

.timeline-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 3px;
    background: #3498db;
    color: white;
    cursor: pointer;
    font-size: 0.8em;
    transition: background-color 0.2s ease;
}

.timeline-btn:hover {
    background: #2980b9;
}

.timeline-progress {
    margin: 10px 0;
}

.timeline-bar {
    width: 100%;
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

.timeline-progress-bar {
    height: 100%;
    background: #27ae60;
    transition: width 0.3s ease;
}

.timeline-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #5a6c7d;
    margin-top: 5px;
}

.timeline-speed {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
}

.speed-selector {
    padding: 2px 6px;
    border: 1px solid #bdc3c7;
    border-radius: 3px;
    font-size: 0.85em;
}

/* Download and action button styling */
.download-btn {
    background: #e67e22;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.download-btn:hover {
    background: #d35400;
    color: white;
}

.download-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.chart-btn {
    background: #9b59b6;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.chart-btn:hover {
    background: #8e44ad;
    color: white;
}

.chart-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

/* Clear all button styling */
.clear-all-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.clear-all-btn:hover {
    background: #7f8c8d;
}

/* Search button styling */
.search-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-weight: 500;
}

.search-btn:hover {
    background: #2980b9;
}

.search-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

/* Track search button specific styling */
.track-search-btn {
    background: #27ae60;
    font-weight: 600;
}

.track-search-btn:hover {
    background: #219a52;
}

/* Button groups in result actions */
.result-actions .download-btn,
.result-actions .chart-btn,
.result-actions .view-btn {
    margin-right: 5px;
}

.result-actions .download-btn:last-child,
.result-actions .chart-btn:last-child,
.result-actions .view-btn:last-child {
    margin-right: 0;
}

/* Bulk download styling */
.search-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.search-buttons button {
    flex: 1;
    min-width: 120px;
}

/* Table action buttons */
.table-card .view-btn,
.table-card .download-btn,
.table-card .chart-btn {
    margin: 2px;
    padding: 4px 8px;
    font-size: 0.8em;
}


/* Chart axis styling */
.axis {
    font-size: 12px;
}

.axis text {
    fill: #333;
    font-family: Arial, sans-serif;
}

.axis path,
.axis line {
    fill: none;
    stroke: #333;
    stroke-width: 1px;
    shape-rendering: crispEdges;
}

.axisgrid path,
.axisgrid line {
    stroke: #ddd;
    stroke-width: 0.5px;
    stroke-dasharray: 2,2;
}

/* Chart labels */
.chartlabel {
    font-size: 14px;
    fill: #333;
    font-family: Arial, sans-serif;
    font-weight: bold;
}

/* Marker cluster styling */
.marker-cluster-small {
    background-color: rgba(181, 226, 140, 0.6);
}
.marker-cluster-small div {
    background-color: rgba(110, 204, 57, 0.6);
}

.marker-cluster-medium {
    background-color: rgba(241, 211, 87, 0.6);
}
.marker-cluster-medium div {
    background-color: rgba(240, 194, 12, 0.6);
}

.marker-cluster-large {
    background-color: rgba(253, 156, 115, 0.6);
}
.marker-cluster-large div {
    background-color: rgba(241, 128, 23, 0.6);
}

/* Marker cluster numbers */
.marker-cluster span {
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

/* Ship marker styling */
.ship-marker {
    border: none !important;
    background: transparent !important;
}

.ship-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: 50% 50% !important;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.2s ease-out;
    position: relative;
}

.ship-icon-container.animated-ship {
    animation: shipBob 2s ease-in-out infinite;
}

.ship-icon-container.static {
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.2));
    opacity: 0.7;
}

/* Ship animation effects */
@keyframes shipBob {
    0%, 100% { 
        filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3)) brightness(1);
    }
    50% { 
        filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.4)) brightness(1.05);
    }
}

/* Ship wake animation */
.ship-icon-container svg path[stroke="#ffffff"] {
    animation: wakeFlow 2s ease-in-out infinite;
}

@keyframes wakeFlow {
    0% { opacity: 0.7; stroke-width: 1.2; }
    25% { opacity: 0.9; stroke-width: 1.5; }
    50% { opacity: 0.5; stroke-width: 1.8; }
    75% { opacity: 0.8; stroke-width: 1.3; }
    100% { opacity: 0.7; stroke-width: 1.2; }
}

/* Navigation lights blinking */
.ship-icon-container svg circle[fill="#22c55e"], 
.ship-icon-container svg circle[fill="#ef4444"] {
    animation: navigationLights 2.5s ease-in-out infinite;
}

.ship-icon-container svg circle[fill="#ef4444"] {
    animation-delay: 0.3s;
}

@keyframes navigationLights {
    0%, 80%, 100% { opacity: 0.9; }
    85%, 95% { opacity: 0.3; }
}

/* Bow indicator subtle pulse */
.ship-icon-container svg path[fill="#ff4757"] {
    animation: bowPulse 3s ease-in-out infinite;
}

@keyframes bowPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Error and loading styles for charts */
.error {
    text-align: center;
    color: #e74c3c;
    padding: 20px;
    font-size: 14px;
    background: #f8f9fa;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    margin: 10px;
}

.loading {
    text-align: center;
    color: #7f8c8d;
    padding: 20px;
    font-size: 14px;
}


/* Auth buttons */
.auth-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-left: 10px;
}

.auth-btn:hover {
    background: #2980b9;
}

.logout-btn {
    background: #e74c3c;
}

.logout-btn:hover {
    background: #c0392b;
}

/* Form submit buttons */
.auth-submit-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s ease;
    width: 100%;
    margin-top: 15px;
}

.auth-submit-btn:hover {
    background: #219a52;
}

/* Track controls styling */
.track-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}


.select-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-size: 0.9em;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    gap: 8px;
}

.checkbox-label input[type="checkbox"] {
    appearance: auto;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    transform: scale(1.2);
}

.bulk-controls {
    display: flex;
    gap: 8px;
}

.bulk-controls .view-table-btn {
    font-size: 0.85em;
    padding: 8px 12px;
}

/* Ship selection checkbox styling */
.table-checkbox {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.table-checkbox input[type="checkbox"] {
    cursor: pointer;
    transform: scale(1.1);
}

/* Ship label styling */
.ship-label {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.ship-label div {
    white-space: nowrap;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

/* Search buttons container styling */
.search-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.search-buttons .clear-all-btn {
    flex: 0 0 auto;
    background: #95a5a6;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s;
    height: fit-content;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-buttons .clear-all-btn:hover {
    background: #7f8c8d;
}

.search-buttons .track-search-btn {
    flex: 1;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sidebar toggle button */
.sidebar-toggle {
    position: absolute;
    top: 70%;
    left: 350px;
    transform: translateY(-50%);
    z-index: 1000;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 12px 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    font-size: 16px;
}

.sidebar-toggle:hover {
    background: #34495e;
    transform: translateY(-50%) translateX(2px);
}

.toggle-icon {
    display: block;
    transition: transform 0.3s ease;
}

/* Sidebar collapsed state */
.map-sidebar.collapsed {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.sidebar-toggle.collapsed {
    left: 0;
    border-radius: 0 8px 8px 0;
}

.sidebar-toggle.collapsed .toggle-icon {
    transform: rotate(180deg);
}

/* ========================================
   즐겨찾기 탭 스타일
   ======================================== */


/* 탭 콘텐츠들이 flex 컨테이너가 되도록 설정 - active 상태에서만 */
.tab-content.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#observation-tab.active,
#track-tab.active,
#favorites-tab.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* 검색 폼은 고정 크기, 검색 결과는 남은 공간 모두 사용 */
.search-form {
    flex-shrink: 0;
}

.search-form h3 {
    flex-shrink: 0;
}

/* 즐겨찾기 서브탭도 flex 컨테이너로 설정 */
.favorites-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
}

.favorites-sub-tabs {
    flex-shrink: 0;
}

/* 즐겨찾기 검색 탭의 내용이 active일 때만 flex되도록 설정 */
#favorites-search-tab.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#favorites-search-tab.active .search-form {
    flex-shrink: 0;
}

#favorites-search-tab.active h3 {
    flex-shrink: 0;
}

/* 내 즐겨찾기 탭도 active일 때만 flex되도록 설정 */
#favorites-my-tab.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#favorites-my-tab.active .workspace-selector,
#favorites-my-tab.active h3 {
    flex-shrink: 0;
}

#favorites-my-tab.active .favorites-workspace-list,
#favorites-my-tab.active .favorites-tree-container {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.favorites-workspace-list {
    display: block;
}

.favorites-tree-container {
    display: none;
}

.add-favorite-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #28a745;
}

.current-location-info {
    text-align: center;
}

.location-coords {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.8em;
    color: #666;
}

.location-coords span {
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-family: monospace;
}

.add-favorite-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.add-favorite-btn:hover {
    background: linear-gradient(135deg, #218838, #1ca085);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.add-favorite-btn:active {
    transform: translateY(0);
}

.favorites-list-section {
    background: white;
    border-radius: 6px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

.section-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1em;
}

.refresh-btn {
    background: none;
    border: none;
    font-size: 0.9em;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.refresh-btn:hover {
    background: #f0f0f0;
}

.favorites-list {
    max-height: calc(100vh - 350px);
    overflow-y: auto;
}

.no-favorites {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9em;
}

.no-favorites p {
    margin: 8px 0;
}

.favorite-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
    padding: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.favorite-item:hover {
    background: #e9ecef;
    border-color: #3498db;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.1);
}

.favorite-item.selected {
    background: #e3f2fd;
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.favorite-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.favorite-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9em;
}

.favorite-actions {
    display: flex;
    gap: 4px;
}

.favorite-action-btn {
    background: none;
    border: none;
    font-size: 0.8em;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.favorite-action-btn.view-btn {
    color: #3498db;
}

.favorite-action-btn.view-btn:hover {
    background: #3498db;
    color: white;
}


.favorite-coords {
    font-size: 0.75em;
    color: #666;
    font-family: monospace;
    margin-bottom: 4px;
}

.favorite-date {
    font-size: 0.7em;
    color: #999;
}

.favorite-description {
    font-size: 0.8em;
    color: #555;
    margin-top: 4px;
    font-style: italic;
}

/* 즐겨찾기 추가 모달 */
.favorite-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.favorite-modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

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

.favorite-modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

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

.favorite-modal-close:hover {
    background: #f0f0f0;
    color: #666;
}

.favorite-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.favorite-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.favorite-form label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9em;
}

.favorite-form input,
.favorite-form textarea,
.favorite-form select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    transition: border-color 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.favorite-form input:focus,
.favorite-form textarea:focus,
.favorite-form select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.favorite-form select:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.favorite-form textarea {
    resize: vertical;
    min-height: 60px;
}

.favorite-form-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.favorite-form-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.favorite-form-btn.save-btn {
    background: #28a745;
    color: white;
}

.favorite-form-btn.save-btn:hover {
    background: #218838;
}

.favorite-form-btn.cancel-btn {
    background: #6c757d;
    color: white;
}

.favorite-form-btn.cancel-btn:hover {
    background: #5a6268;
}

/* ========================================
   즐겨찾기 서브탭 스타일
   ======================================== */

.favorites-sub-tabs {
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.sub-tab-buttons {
    display: flex;
    gap: 0;
}

.sub-tab-btn {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.9em;
    color: #666;
    transition: all 0.2s ease;
    border-radius: 4px 4px 0 0;
}

.sub-tab-btn:first-child {
    border-radius: 4px 0 0 0;
}

.sub-tab-btn:last-child {
    border-radius: 0 4px 0 0;
}

.sub-tab-btn.active {
    background: white;
    color: #2c3e50;
    font-weight: 600;
    border-bottom: 2px solid white;
    position: relative;
    z-index: 1;
}

.sub-tab-btn:hover:not(.active) {
    background: #e9ecef;
    color: #495057;
}

.sub-tab-content {
    display: none;
    padding-top: 10px;
}

.sub-tab-content.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* ========================================
   워크스페이스 선택 모달 스타일
   ======================================== */

.workspace-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 !important;
    padding: 0 !important;
}

.workspace-modal-content {
    background-color: white;
    border-radius: 8px;
    width: 400px;
    max-width: 90vw;
    max-height: 80vh;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow-y: auto;
}

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

.workspace-modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2em;
}

.workspace-modal-close {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.workspace-modal-close:hover {
    color: #333;
}

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

.workspace-item-info {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.workspace-item-info h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1em;
}

.workspace-item-info p {
    margin: 5px 0;
    color: #555;
}

.workspace-selection h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1em;
}

.workspace-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
}

.workspace-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.workspace-modal-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.workspace-modal-btn.cancel-btn {
    background: #95a5a6;
    color: white;
}

.workspace-modal-btn.cancel-btn:hover {
    background: #7f8c8d;
}

.workspace-modal-btn.confirm-btn {
    background: #3498db;
    color: white;
}

.workspace-modal-btn.confirm-btn:hover {
    background: #2980b9;
}

/* Workspace Favorites Display Styles */
.workspace-favorites-view {
    padding: 10px 0;
}

.workspace-favorites-view h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1em;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.favorites-category {
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.favorites-category h5 {
    margin: 0;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    font-size: 0.95em;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
}

.favorites-list {
    background: white;
}

.favorite-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.favorite-item:hover {
    background-color: #f8f9fa;
}

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

.favorite-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.favorite-icon {
    font-size: 1.1em;
    flex-shrink: 0;
}

.favorite-name {
    font-weight: 500;
    color: #2c3e50;
    flex-grow: 1;
}

.favorite-coords {
    font-size: 0.85em;
    color: #666;
    font-family: 'Courier New', monospace;
}

.favorite-description {
    font-size: 0.9em;
    color: #555;
    margin: 5px 0;
    padding-left: 24px;
    line-height: 1.4;
}

.favorite-details {
    display: flex;
    gap: 12px;
    padding-left: 24px;
    font-size: 0.8em;
}

.favorite-type {
    background: #e3f2fd;
    color: #1565c0;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.favorite-layer {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

/* All Workspaces View Styles */
.all-workspaces-view {
    padding: 10px 0;
}

.all-workspaces-view h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1em;
    padding-bottom: 5px;
}

/* Workspace header with sort controls */
.workspace-header-with-sort {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.workspace-sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-reverse-checkbox {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85em;
    color: #555;
    cursor: pointer;
    user-select: none;
}

.sort-reverse-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3498db;
}

.sort-reverse-checkbox span {
    font-weight: 500;
}

.sort-reverse-checkbox:hover span {
    color: #3498db;
}

.workspace-sort-select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85em;
    background: white;
    cursor: pointer;
    min-width: 140px;
    height: 28px;
}

.workspace-sort-select:hover {
    border-color: #3498db;
    background: #f8f9fa;
}

.workspace-sort-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.workspaces-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.workspace-summary {
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.workspace-summary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #3498db;
}

.workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.workspace-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1em;
}

.workspace-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.workspace-description {
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
}

/* Workspace Section Styles (for all workspaces view) */
.workspace-section {
    margin-bottom: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.workspace-header-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.workspace-title-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.workspace-title-section:hover {
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
    padding: 2px 6px;
    margin: -2px -6px;
    transition: background-color 0.2s ease;
}

.workspace-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.workspace-action-btn {
    padding: 6px 12px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background: white;
    color: #24292f;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.workspace-action-btn:hover {
    background: #f6f8fa;
    border-color: #d0d7de;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.workspace-action-btn:active {
    background: #e9ecef;
    transform: translateY(1px);
}

.workspace-action-btn.view-all-btn {
    background: #0969da;
    color: white;
    border-color: #0969da;
}

.workspace-action-btn.view-all-btn:hover {
    background: #0860ca;
    border-color: #0860ca;
}

.workspace-action-btn.view-all-btn.collapsed {
    background: white;
    color: #0969da;
    border-color: #0969da;
}

.workspace-action-btn.view-all-btn.collapsed:hover {
    background: #f6f8fa;
    color: #0860ca;
    border-color: #0860ca;
}

.workspace-action-btn.toggle-btn {
    font-size: 1rem;
    padding: 4px 8px;
}

/* Individual favorite visibility toggle */
.favorite-item.favorite-hidden {
    opacity: 0.5;
}

.favorite-item.favorite-hidden .favorite-name {
    text-decoration: line-through;
    color: #999;
}

.favorite-action-btn.toggle-visibility-btn {
    font-size: 1rem;
    padding: 2px 6px;
    min-width: 28px;
    height: 28px;
}

/* Filter no results message */
.filter-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.filter-no-results p {
    margin-bottom: 15px;
    font-size: 0.95em;
}

.clear-filters-btn {
    padding: 8px 20px;
    background: #4A90E2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.2s;
}

.clear-filters-btn:hover {
    background: #357ABD;
}

.workspace-header-section h5 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Favorite workspace star animation */
.workspace-header-section h5:has(⭐) {
    position: relative;
}

.workspace-section h5 {
    animation: none;
}

.workspace-section h5:hover {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

.workspace-header-section .workspace-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.workspace-header-section .workspace-color.empty {
    background: white !important;
    border: 3px solid;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.workspace-section .workspace-description {
    padding: 10px 20px;
    background: #f8f9fa;
    color: #666;
    font-size: 0.9em;
    border-bottom: 1px solid #e0e0e0;
}

.workspace-tags-section {
    padding: 8px 20px;
    background: #fafbfc;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.workspace-tag {
    display: inline-block;
    padding: 3px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 0.85em;
    border: 1px solid #bbdefb;
}

.workspace-favorites-list {
    padding: 15px;
    background: white;
}

.workspace-favorites-list .favorite-item {
    margin-bottom: 12px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    background: #fafafa;
}

.workspace-favorites-list .favorite-item:last-child {
    margin-bottom: 0;
}

/* Favorite actions at bottom layout */
.favorite-actions-bottom {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #e0e0e0;
    margin-top: 8px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.favorite-actions-bottom .favorite-action-btn {
    padding: 6px 10px;
    font-size: 1.1em;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

/* 보기 버튼 기본값 - 안보기 상태 (회색) */
.favorite-actions-bottom .toggle-visibility-btn {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

.favorite-actions-bottom .favorite-action-btn:hover {
    background: #f5f5f5;
    border-color: #3498db;
}

.favorite-actions-bottom .toggle-visibility-btn:hover {
    background: #e3f2fd;
    border-color: #2196f3;
}

.favorite-actions-bottom .edit-btn:hover {
    background: #fff3e0;
    border-color: #ff9800;
}


.favorite-actions-bottom .history-btn:hover {
    background: #f3e5f5;
    border-color: #9c27b0;
}

/* Disabled button styles for view-only permissions */
.favorite-actions-bottom .favorite-action-btn.disabled {
    background: #f5f5f5 !important;
    border-color: #ddd !important;
    color: #ccc !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.favorite-actions-bottom .favorite-action-btn.disabled:hover {
    background: #f5f5f5 !important;
    border-color: #ddd !important;
    color: #ccc !important;
    transform: none !important;
}

.favorite-actions-bottom .favorite-action-btn[disabled] {
    background: #f5f5f5 !important;
    border-color: #ddd !important;
    color: #ccc !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.favorite-actions-bottom .favorite-action-btn[disabled]:hover {
    background: #f5f5f5 !important;
    border-color: #ddd !important;
    color: #ccc !important;
    transform: none !important;
}

/* Workspace empty and error states */
.workspace-empty-state,
.workspace-error-state {
    padding: 20px;
    text-align: center;
    background: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 6px;
    margin: 10px 0;
}

.workspace-empty-state .empty-message {
    color: #666;
    font-size: 0.9em;
    margin: 0 0 5px 0;
    font-weight: 500;
}

.workspace-empty-state small {
    color: #888;
    font-size: 0.8em;
}

.workspace-error-state .error-message {
    color: #e74c3c;
    font-size: 0.9em;
    margin: 0 0 5px 0;
    font-weight: 500;
}

.workspace-error-state small {
    color: #888;
    font-size: 0.8em;
}

.no-favorites-in-workspace {
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
    background: #f8f9fa;
}

.error-loading-favorites {
    padding: 20px;
    text-align: center;
    color: #e74c3c;
    background: #ffebee;
    border-left: 4px solid #f44336;
}

/* Table Favorites Styles */
.table-favorite-item {
    border-left: 4px solid #3498db;
}

.table-favorite-item .favorite-header {
    padding: 10px;
    padding-bottom: 5px;
    font-weight: 600;
    font-size: 1em;
}

.table-favorite-item .favorite-name {
    color: #2c3e50;
    font-size: 1.05em;
}

.table-favorite-item .favorite-description {
    padding: 0 10px;
    color: #666;
    font-size: 0.9em;
}

.table-favorite-item .favorite-details {
    padding: 5px 10px;
    display: flex;
    gap: 15px;
    font-size: 0.85em;
    color: #777;
}

.favorite-actions {
    display: flex;
    gap: 5px;
    margin-left: auto;
}

.favorite-action-btn {
    background: none;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 14px;
    transition: background-color 0.2s;
}

.favorite-action-btn:hover {
    background-color: #f0f0f0;
}

.favorite-action-btn.edit-btn:hover {
    background-color: #e3f2fd;
}


.favorite-action-btn.history-btn:hover {
    background-color: #f3e5f5;
}

.favorite-order,
.favorite-created,
.favorite-updated {
    font-size: 0.75em;
    color: #666;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 8px;
}

.favorite-created {
    background: #e8f5e8;
    color: #2e7d32;
}

.favorite-updated {
    background: #fff3e0;
    color: #f57c00;
}

/* History Modal Styles */
.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 12px;
    transition: box-shadow 0.2s;
}

.history-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.history-item.action-insert {
    border-left: 4px solid #4caf50;
    background: #f1f8e9;
}

.history-item.action-update {
    border-left: 4px solid #ff9800;
    background: #fff8e1;
}

.history-item.action-delete {
    border-left: 4px solid #f44336;
    background: #ffebee;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
}

.history-action {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    color: white;
}

.action-insert .history-action {
    background: #4caf50;
}

.action-update .history-action {
    background: #ff9800;
}

.action-delete .history-action {
    background: #f44336;
}

.history-timestamp {
    font-size: 0.8em;
    color: #666;
    font-weight: normal;
}

.history-details {
    font-size: 0.9em;
    line-height: 1.4;
}

.history-details > div {
    margin-bottom: 4px;
}

.history-details > div:last-child {
    margin-bottom: 0;
}

/* ========================================
   즐겨찾기 조회 결과 스타일
   ======================================== */

/* 테이블 전체 데이터 표시 스타일 */
.table-data-header {
    background: #f8f9fa;
    padding: 15px;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 10px;
}

.table-data-header h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1.2em;
}

.table-info {
    margin: 0;
    color: #6c757d;
    font-size: 0.9em;
}

.full-table-data {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.full-data-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    transition: all 0.2s ease;
}

.full-data-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0,123,255,0.1);
}

.full-data-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.item-number {
    background: #007bff;
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.geometry-icon {
    font-size: 1.1em;
}

.full-data-name {
    font-weight: 600;
    color: #2c3e50;
    flex-grow: 1;
}

.full-data-coords {
    color: #6c757d;
    font-size: 0.9em;
    font-family: monospace;
}

.full-data-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.data-info {
    color: #28a745;
    font-size: 0.9em;
    font-weight: 500;
}

.full-data-actions {
    display: flex;
    gap: 5px;
}

.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

.favorites-search-results {
    margin-top: 15px;
    flex: 1;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: white;
    min-height: 200px;
    max-height: calc(100vh - 500px);; /* 고정 최대 높이로 스크롤 강제 */
}

.search-result-item {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f8f9fa;
}

.search-result-item.selected {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.search-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.search-result-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9em;
}

.search-result-actions {
    display: flex;
    gap: 4px;
}

.search-result-btn {
    background: none;
    border: none;
    font-size: 0.8em;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.search-result-btn.add-btn {
    color: #28a745;
    border: 1px solid #28a745;
}

.search-result-btn.add-btn:hover {
    background: #28a745;
    color: white;
}

.search-result-btn.view-btn {
    color: #007bff;
    border: 1px solid #007bff;
}

.search-result-btn.view-btn:hover {
    background: #007bff;
    color: white;
}

.search-result-details {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 4px;
}

.search-result-geom {
    display: inline-block;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.7em;
    margin-right: 8px;
}

/* ========================================
   워크스페이스 선택기 스타일
   ======================================== */

/* 워크스페이스 검색 섹션 */
.workspace-search-section {
    background: #f0f4f8;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid #d0d7de;
}

.workspace-search-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.workspace-search-container label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9em;
    white-space: nowrap;
    width: 120px;
    flex-shrink: 0;
}

.workspace-search-container input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    max-width: 167px;
    box-sizing: border-box;
}

.workspace-search-container input:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.workspace-search-container .search-btn {
    display: none; /* 검색 버튼 숨김 - Enter 키로만 검색 */
}

/* 워크스페이스 검색 섹션 개선 */
.workspace-search-section {
    margin-bottom: 15px;
}

.workspace-search-container {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.workspace-search-container label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.search-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.search-input-group input[type="text"] {
    padding: 3px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    background: white;
    height: 27px; /* 기존보다 5px 감소 */
    transition: all 0.2s ease;
    box-sizing: border-box;
    width: 100%; /* 좌우폭은 컨테이너에 맞춤 */
}

.search-input-group input[type="text"]:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.search-input-group input[type="text"].disabled-search {
    background-color: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

.search-input-group input[type="text"].favorites-filter-active {
    border: 2px solid #ffd700;
    background-color: #fffaf0;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.workspace-favorites-filter {
    display: flex;
    align-items: center;
    order: -1; /* 텍스트박스 위로 이동 */
    margin-bottom: 4px;
    justify-content: flex-start; /* 왼쪽 정렬 */
}

.workspace-favorites-filter label {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 0.85em;
    color: #555;
    cursor: pointer;
    user-select: none;
    font-weight: normal;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1;
    width: 90px !important; /* 라벨 자체의 고정 크기를 60px로 설정 (약 80px에서 20px 줄임) */
    max-width: 90px !important;
}

.workspace-favorites-filter input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #4A90E2;
    margin: 0 !important;
    margin-right: -2px !important; /* 오른쪽 공간 제거 */
    padding: 0 !important;
    border: none;
    outline: none;
    flex-shrink: 0;
    vertical-align: top;
    position: relative;
    display: inline-block;
}

.workspace-favorites-filter label span {
    margin: 0 !important;
    padding: 0 !important;
    margin-left: 1px !important; /* 최소한의 간격만 */
    line-height: 1;
    display: inline-block;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .workspace-search-container {
        padding: 10px;
    }
    
    .search-input-group input[type="text"] {
        padding: 3px 10px;
        height: 25px;
        font-size: 0.85em;
    }
    
    .workspace-favorites-filter label {
        font-size: 0.8em;
        gap: 0; /* 모바일에서도 여백 제거 */
        margin: 0;
        padding: 0;
        width: 55px !important; /* 모바일에서는 더 작게 55px */
        max-width: 55px !important;
    }
    
    .workspace-favorites-filter input[type="checkbox"] {
        width: 14px;
        height: 14px;
        margin: 0 !important;
        margin-right: -2px !important;
        padding: 0 !important;
    }
    
    .workspace-favorites-filter label span {
        margin: 0 !important;
        padding: 0 !important;
        margin-left: 0px !important; /* 모바일에서는 간격 제거 */
    }
}

/* 이전 workspace-selector 스타일 (호환성 유지) */
.workspace-selector {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

.workspace-selector label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9em;
}

.workspace-selector select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    background: white;
}

/* ========================================
   워크스페이스별 즐겨찾기 목록 스타일
   ======================================== */

.favorites-workspace-list {
    max-height: calc(100vh - 430px);
    overflow-y: auto;
}

.workspace-group {
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.workspace-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 10px 15px;
    font-weight: 600;
    font-size: 0.9em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.workspace-header:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
}

.workspace-toggle {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.workspace-header.collapsed .workspace-toggle {
    transform: rotate(-90deg);
}

.workspace-content {
    overflow: visible;
    transition: max-height 0.3s ease;
}

.workspace-content.collapsed {
    max-height: 0;
}

.category-group {
    border-top: 1px solid #f0f0f0;
}

.category-header {
    background: #f8f9fa;
    padding: 8px 15px;
    font-weight: 600;
    font-size: 0.85em;
    color: #495057;
    border-left: 3px solid #6c757d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.category-header:hover {
    background: #e9ecef;
}

.category-toggle {
    font-size: 0.7em;
    transition: transform 0.3s ease;
}

.category-header.collapsed .category-toggle {
    transform: rotate(-90deg);
}

.category-content {
    max-height: 200px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.category-content.collapsed {
    max-height: 0;
}

.category-favorites {
    padding: 0;
}

.workspace-favorite-item {
    background: white;
    border-bottom: 1px solid #f0f0f0;
    padding: 10px 15px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.workspace-favorite-item:hover {
    background: #f8f9fa;
    border-left: 3px solid #3498db;
}

.workspace-favorite-item.selected {
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
}

.workspace-favorite-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.workspace-favorite-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.85em;
}

.workspace-favorite-actions {
    display: flex;
    gap: 4px;
}

.workspace-favorite-details {
    font-size: 0.75em;
    color: #666;
    margin-bottom: 2px;
}

.workspace-favorite-coords {
    font-size: 0.7em;
    color: #999;
    font-family: monospace;
}

/* Time interval controls styling */
.time-interval-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.time-interval-controls label {
    font-size: 0.8em;
    color: #5a6c7d;
    white-space: nowrap;
    margin: 0;
}

.time-interval-controls select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.8em;
    background: white;
    min-width: 80px;
}

/* Selection controls styling */
.selection-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    gap: 10px;
    flex-wrap: wrap;
}


.checkbox-label {
    display: flex;
    align-items: center;
    font-size: 0.9em;
    color: #2c3e50;
    cursor: pointer;
    margin: 0;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 6px;
    cursor: pointer;
    transform: scale(1.1);
}

.clear-all-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.clear-all-btn:hover {
    background: #7f8c8d;
}

/* Bulk actions styling */
.bulk-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.show-selected-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.show-selected-btn:hover {
    background: #219a52;
}

.show-selected-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

/* Map search summary styling */
.map-search-summary {
    margin-top: 10px;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.map-search-summary .selected-count {
    font-size: 0.9em;
    color: #5a6c7d;
    margin: 0;
    text-align: center;
}

/* Map item checkbox styling */
.map-item-checkbox {
    cursor: pointer;
    transform: scale(1.1);
    margin-right: 8px;
}

/* Search results header responsive design */
@media (max-width: 400px) {
    .search-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .time-interval-controls {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }
    
    .selection-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .select-controls,
    .bulk-actions {
        justify-content: center;
    }
}

/* Form control styling for better consistency */
.form-control {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85em;
    background: white;
    color: #333;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* ========================================
   Tree View Styles for Favorites2
   ======================================== */

.favorites-tree-container {
    margin-top: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #fff;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

.tree-view {
    padding: 10px;
}

/* Tree Node Base Styling */
.tree-node {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tree-node-content {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}

.tree-node-content:hover {
    background-color: #f8f9fa;
}

.tree-node-content.selected {
    background-color: #e3f2fd;
    border-left: 3px solid #2196f3;
}

/* Tree Toggle Button */
.tree-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 3px;
    font-size: 12px;
    color: #666;
    transition: all 0.2s ease;
}

.tree-toggle:hover {
    background-color: #e9ecef;
    color: #333;
}

.tree-toggle.expanded::before {
    content: "▼";
}

.tree-toggle.collapsed::before {
    content: "▶";
}

.tree-toggle.no-children {
    visibility: hidden;
}

/* Tree Node Icons */
.tree-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.tree-icon.workspace {
    color: #3498db;
}

.tree-icon.category {
    color: #e67e22;
}

.tree-icon.favorite {
    color: #27ae60;
}

/* Tree Node Labels */
.tree-label {
    flex: 1;
    font-size: 14px;
    color: #333;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.tree-label.workspace {
    font-weight: 600;
    color: #2c3e50;
}

.tree-label.category {
    font-weight: 500;
    color: #34495e;
}

.tree-label.favorite {
    font-weight: normal;
    color: #5a6c7d;
}

/* Tree Node Actions */
.tree-actions {
    display: flex;
    gap: 4px;
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tree-node-content:hover .tree-actions {
    opacity: 1;
}

.tree-action-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: #f8f9fa;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.tree-action-btn:hover {
    background: #e9ecef;
    transform: scale(1.1);
}

.tree-action-btn.view-btn {
    color: #3498db;
}

.tree-action-btn.eye-btn,
.favorite-action-btn.eye-btn,
.tree-content-toggle-btn.eye-btn {
    color: #3498db;
    font-size: 16px;
    transition: all 0.2s;
}

.tree-action-btn.eye-btn.eye-open,
.favorite-action-btn.eye-btn.eye-open,
.tree-content-toggle-btn.eye-btn.eye-open {
    color: #2ecc71;  /* 초록색 - 표시 중 */
}

.tree-action-btn.eye-btn.eye-closed,
.favorite-action-btn.eye-btn.eye-closed,
.tree-content-toggle-btn.eye-btn.eye-closed {
    color: #95a5a6;  /* 회색 - 숨김 */
}

.tree-action-btn.eye-btn:hover,
.favorite-action-btn.eye-btn:hover,
.tree-content-toggle-btn.eye-btn:hover {
    transform: scale(1.2);
}


/* Tree content toggle button styles */
.tree-content-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    margin-left: 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
    font-size: 14px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.tree-content-toggle-btn:hover {
    background-color: rgba(52, 152, 219, 0.1);
    opacity: 1;
}

.tree-content-toggle-btn:active {
    transform: scale(0.95);
}

/* Tree content actions container */
.tree-content-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Tree content delete button styles */
.tree-content-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
    font-size: 14px;
    transition: all 0.2s ease;
    color: #e74c3c;
    opacity: 0.7;
}

.tree-content-delete-btn:hover {
    background-color: rgba(231, 76, 60, 0.1);
    opacity: 1;
    transform: scale(1.1);
}

.tree-content-delete-btn:active {
    transform: scale(0.95);
}


/* 새로운 즐겨찾기 검색 디자인 */
.favorites-search-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
}

.search-header {
    margin-bottom: 12px;
    text-align: left;
}

.search-header h4 {
    margin: 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.search-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-input-container {
    width: 100%;
}

.search-box-with-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-checkbox {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.search-checkbox input[type="checkbox"] {
    display: none;
}

.checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: white;
    border: 2px solid #ced4da;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    color: #6c757d;
}

.search-checkbox input[type="checkbox"]:checked + .checkbox-label {
    background: #3498db;
    border-color: #3498db;
    color: white;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

.checkbox-label:hover {
    border-color: #3498db;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

.search-checkbox input[type="checkbox"]:checked + .checkbox-label:hover {
    background: #2980b9;
    border-color: #2980b9;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid #ced4da;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-input::placeholder {
    color: #6c757d;
    font-style: italic;
}

.search-clear-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #6c757d;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.search-clear-btn:hover {
    background: #f8f9fa;
    color: #495057;
}



/* Favorite actions container */
.favorite-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.favorite-item:hover .favorite-actions {
    opacity: 1;
}

/* Favorite header layout */
.favorite-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.favorite-name {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

/* Tree Children */
.tree-children {
    margin-left: 28px;
    border-left: 1px dashed #ddd;
    padding-left: 0;
    transition: all 0.3s ease;
}

.tree-children.collapsed {
    display: none;
}

.tree-children .tree-node {
    position: relative;
}

.tree-children .tree-node::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 16px;
    width: 20px;
    height: 1px;
    border-top: 1px dashed #ddd;
}

/* Tree Node Details */
.tree-node-details {
    margin-left: 46px;
    padding: 4px 8px;
    font-size: 11px;
    color: #888;
    background: #f8f9fa;
    border-radius: 3px;
    margin-top: 4px;
    border-left: 2px solid #e9ecef;
}

.tree-coordinates {
    font-family: monospace;
    color: #666;
}

.tree-description {
    font-style: italic;
    color: #999;
    margin-top: 2px;
}

.tree-metadata {
    display: flex;
    gap: 10px;
    margin-top: 2px;
}

.tree-geomtype {
    background: #e3f2fd;
    color: #1976d2;
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 500;
}

.tree-layername {
    color: #666;
    font-size: 10px;
}

/* Tree View Animations */
.tree-node {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tree Search/Filter */
.tree-search {
    margin-bottom: 10px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    font-size: 13px;
}

.tree-search:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Tree Empty State */
.tree-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
}

/* Scrollbar for tree container */
.favorites-tree-container::-webkit-scrollbar {
    width: 8px;
}

.favorites-tree-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.favorites-tree-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.favorites-tree-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ===============================
   Workspace Search Interface Styles
   =============================== */

/* Workspace search container */
.workspace-search-container {
    position: relative;
    margin-bottom: 15px;
}

.workspace-search-input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.workspace-search-input:focus {
    outline: none;
    border-color: #4A90E2;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.workspace-search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 16px;
}

/* Filter options */
.workspace-filter-options {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: #555;
}

.filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4A90E2;
}

.filter-option:hover {
    color: #333;
}

/* Workspace options container */
.workspace-options-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    background-color: #ffffff;
}

.workspace-options-container::-webkit-scrollbar {
    width: 6px;
}

.workspace-options-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.workspace-options-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.workspace-options-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Individual workspace option */
.workspace-option {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.workspace-option:hover {
    background-color: #f8f9fa;
    border-left: 4px solid #4A90E2;
}

.workspace-option.selected {
    background-color: #e3f2fd;
    border-left: 4px solid #4A90E2;
    box-shadow: inset 0 0 0 1px rgba(74, 144, 226, 0.2);
}

.workspace-option:last-child {
    border-bottom: none;
}

/* Workspace option header */
.workspace-option-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.workspace-color-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.workspace-name {
    font-weight: 600;
    color: #333;
    flex: 1;
    font-size: 14px;
}

.workspace-favorite-icon {
    color: #ffc107;
    font-size: 14px;
    flex-shrink: 0;
}

/* Workspace description */
.workspace-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* Workspace tags */
.workspace-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.workspace-tag {
    background-color: #e3f2fd;
    color: #1976d2;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid rgba(25, 118, 210, 0.2);
}

/* No workspaces message */
.no-workspaces-message {
    padding: 30px 20px;
    text-align: center;
    color: #666;
    font-style: italic;
    background-color: #f8f9fa;
    border-radius: 8px;
}

/* Enhanced workspace modal styles */
.workspace-modal .workspace-selection {
    margin-top: 20px;
}

.workspace-modal .workspace-selection h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .workspace-search-input {
        padding: 10px 35px 10px 12px;
        font-size: 13px;
    }
    
    .workspace-search-icon {
        right: 12px;
        font-size: 14px;
    }
    
    .workspace-option {
        padding: 12px;
    }
    
    .workspace-option-header {
        gap: 8px;
        margin-bottom: 6px;
    }
    
    .workspace-name {
        font-size: 13px;
    }
    
    .workspace-description {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    .workspace-tag {
        padding: 2px 6px;
        font-size: 10px;
    }
}

/* ===============================
   Enhanced Workspace Select Styles
   =============================== */

/* Enhanced workspace select container */
.enhanced-workspace-select-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1; /* workspace-filter-section과 호환 */
}

/* workspace-filter-section 내부에서의 스타일링 조정 */
.workspace-filter-section .enhanced-workspace-select-container {
    flex: 1;
    gap: 6px;
}

.workspace-filter-section .workspace-select-search {
    position: relative;
    width: 100%;
}

.workspace-filter-section .workspace-select-search-input {
    width: 100%;
    padding: 6px 25px 6px 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    background: white;
}

.workspace-filter-section .workspace-select-search i {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 0.8em;
    pointer-events: none;
}

.workspace-filter-section .workspace-select-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0;
}

.workspace-filter-section .workspace-select-filters label {
    font-size: 0.8em;
    font-weight: normal;
    color: #666;
    width: auto;
    white-space: nowrap;
}


/* Workspace select search */
.workspace-select-search {
    position: relative;
}

.workspace-select-search-input {
    width: 100%;
    padding: 8px 30px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background-color: #fff;
    transition: border-color 0.2s ease;
}

.workspace-select-search-input:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.workspace-select-search i {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 12px;
}

/* Workspace select filters */
.workspace-select-filters {
    display: flex;
    align-items: center;
    gap: 12px;
}

.workspace-select-filters label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    user-select: none;
}

.workspace-select-filters input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #4A90E2;
}

/* Enhanced workspace select */

/* Responsive design for enhanced select */
@media (max-width: 768px) {
    .workspace-select-search-input {
        padding: 6px 25px 6px 10px;
        font-size: 12px;
    }
    
    .workspace-select-search i {
        right: 8px;
        font-size: 11px;
    }
    
    .workspace-select-filters label {
        font-size: 11px;
        gap: 4px;
    }
    
    .workspace-select-filters input[type="checkbox"] {
        width: 12px;
        height: 12px;
    }
}

/* ========================================
   Favorites Tree Structure Styles
   ======================================== */

/* Hide old favorite-item styles when tree structure is active */
.favorites-tree-group ~ .favorite-item,
#favoritesWorkspaceList:has(.favorites-tree-group) .favorite-item:not(.favorite-tree-item),
#favoritesWorkspaceList .favorite-item:not(.favorite-tree-item),
.workspace-favorite-item,
.workspace-favorites-list {
    display: none !important;
}

/* Tree Group Container */
.favorites-tree-group {
    margin-bottom: 5px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: #ffffff;
    overflow: hidden;
}

/* Workspace Level (Level 1) */
.favorites-workspace-item {
    display: flex;
    align-items: center;
    padding: 5px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 600;
}

.favorites-workspace-item:hover {
    background: #e9ecef;
}

.favorites-workspace-item.selected {
    background: #e3f2fd !important;
    color: #1976d2;
    border-left: 3px solid #1976d2;
}

.favorites-workspace-item.selected .favorites-workspace-name {
    color: #1976d2;
}

.favorites-workspace-item.selected .favorites-workspace-count {
    background: #bbdefb;
    color: #1976d2;
}

.favorites-tree-expand {
    margin-right: 8px;
    font-size: 12px;
    width: 16px;
    text-align: center;
    color: #6c757d;
    transition: transform 0.2s;
}

.favorites-workspace-icon {
    margin-right: 10px;
    font-size: 16px;
}

.favorites-workspace-name {
    flex: 1;
    color: #2c3e50;
}

.favorites-workspace-count {
    font-size: 12px;
    color: #6c757d;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
}

.favorites-workspace-content {
    background: #fdfdfd;
}

/* Category Level (Level 2) */
.favorites-category-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    margin-left: 20px;
    border-left: 2px solid #e9ecef;
    background: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 500;
}

.favorites-category-item:hover {
    background: #f8f9fa;
}

.favorites-category-icon {
    margin-right: 8px;
    font-size: 14px;
}

.favorites-category-name {
    flex: 1;
    color: #495057;
    font-size: 14px;
}

.favorites-category-count {
    font-size: 11px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 10px;
}

.favorites-category-content {
    background: #fefefe;
}

/* Favorite Items (Level 3) */
.favorite-tree-item {
    display: flex;
    align-items: flex-start;
    padding: 2px 20px;
    margin-left: 40px;
    border-left: 2px solid #f0f0f0;
    background: #ffffff;
    border-bottom: 1px solid #f8f9fa;
    transition: all 0.2s;
}

.favorite-tree-item:hover {
    background: #f8f9fa;
    border-left-color: #3498db;
}

.favorite-tree-item:last-child {
    border-bottom: none;
}

.favorite-tree-icon {
    margin-right: 12px;
    font-size: 12px;
    color: #3498db;
    margin-top: 2px;
}

.favorite-tree-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: text-align 0.2s ease;
}

.favorite-tree-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.favorite-tree-item:hover .favorite-tree-actions {
    opacity: 1;
}

.favorite-tree-content:hover {
    text-align: center;
}

.favorite-tree-name {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 4px;
    word-break: break-word;
}

.favorite-tree-coords {
    font-size: 12px;
    color: #6c757d;
    font-family: monospace;
    margin-bottom: 4px;
}

.favorite-tree-description {
    font-size: 12px;
    color: #868e96;
    line-height: 1.4;
    word-break: break-word;
    margin: 0;
    padding: 0;
    position: relative;
    box-sizing: border-box;
}

.favorite-tree-description:hover {
    color: #868e96;
    margin: 0;
    padding: 0;
    text-indent: 0;
    transform: none;
}

/* 부모 요소 hover 상태에서도 favorite-tree-description 고정 */
.favorite-item:hover .favorite-tree-description,
.tree-node-content:hover .favorite-tree-description,
.workspace-favorite-item:hover .favorite-tree-description {
    margin: 0 !important;
    padding: 0 !important;
    text-indent: 0 !important;
    transform: none !important;
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
}

.favorite-tree-actions {
    display: flex;
    gap: 6px;
    margin-left: 12px;
    align-self: flex-start;
    margin-top: 2px;
}

.favorite-tree-actions .favorite-action-btn {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.favorite-tree-actions .view-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    margin-right: 4px;
}

.favorite-tree-actions .view-btn:hover {
    background: #0056b3;
}


/* Empty states */
.favorites-tree-group:empty {
    display: none;
}

/* Responsive design for tree structure */
@media (max-width: 768px) {
    .favorites-category-item {
        margin-left: 15px;
    }
    
    .favorite-tree-item {
        margin-left: 30px;
        padding: 10px 15px;
    }
    
    .favorite-tree-icon {
        margin-right: 8px;
    }
    
    .favorite-tree-actions {
        margin-left: 8px;
    }
}

/* ========================================
   Enhanced Tree Structure Styles
   ======================================== */

/* Permission badges */
.favorites-workspace-permission {
    margin-right: 10px;
}

.permission-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.permission-badge.owner {
    background: #2ecc71;
    color: white;
}

.permission-badge.edit {
    background: #3498db;
    color: white;
}

.permission-badge.view {
    background: #95a5a6;
    color: white;
}

.permission-badge.none {
    background: #e74c3c;
    color: white;
}

/* Workspace actions */
.favorites-workspace-actions {
    display: flex;
    gap: 5px;
    margin-left: 8px;
}

.favorites-category-actions {
    display: flex;
    gap: 5px;
    margin-left: 8px;
}

.favorites-toggle-btn {
    background: #dc3545;  /* 기본 상태 (숨기기) - 빨간색 */
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    min-width: 40px;
}

.favorites-toggle-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.favorites-toggle-btn:active {
    transform: translateY(0);
}

.favorites-toggle-btn.map-display-off {
    background: #007bff;  /* 지도표기 상태 - 파란색 */
    color: white;
}

.favorites-toggle-btn.map-display-off:hover {
    background: #0056b3;
}

.favorites-workspace-item {
    display: flex;
    align-items: center;
    padding: 5px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 600;
}

.favorites-category-item {
    display: flex;
    align-items: center;
    padding: 5px 15px;
    margin-left: 20px;
    background: white;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background-color 0.2s;
}

/* Search results */
.search-no-results {
    text-align: center;
    padding: 20px;
    color: #666;
    background: #f9f9f9;
    border: 1px dashed #ccc;
    border-radius: 8px;
    margin: 10px;
}

.clear-search-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 8px;
    font-size: 12px;
}

.clear-search-btn:hover {
    background: #0056b3;
}

/* Enhanced workspace item layout */
.favorites-workspace-item .favorites-workspace-name {
    flex: 1;
    margin-right: 10px;
}

.favorites-category-item .favorites-category-name {
    flex: 1;
    margin-right: 10px;
}

/* ========================================
   Map Reset Button Styles
   ======================================== */

.map-reset-button-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    pointer-events: none;
}

.map-reset-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
    transition: all 0.3s ease;
    min-width: 100px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.map-reset-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
    transform: translateY(-2px);
}

.map-reset-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.map-reset-btn i {
    font-size: 16px;
    animation: none;
}

.map-reset-btn:hover i {
    animation: spin 0.5s ease-in-out;
}

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

.map-reset-btn span {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .map-reset-button-container {
        bottom: 15px;
        right: 15px;
    }
    
    .map-reset-btn {
        padding: 10px 14px;
        font-size: 13px;
        min-width: 90px;
    }
    
    .map-reset-btn i {
        font-size: 14px;
    }
}

/* Arrow marker styles for track data */
.arrow-marker {
    background: transparent !important;
    border: none !important;
    pointer-events: auto;
}

.arrow-marker div {
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    font-weight: bold;
    transform-origin: center;
    transition: transform 0.2s ease;
}

/* 호버 효과 제거 */



