/* Custom styles for the WebGIS 3D application */

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

.loading-spinner {
    animation: spin 1s linear infinite;
}

/* Control panel enhancements */
.control-panel {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-panel:hover {
    background: rgba(255, 255, 255, 0.95);
}

/* Button groups */
.btn-group-vertical .btn {
    border-radius: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-group-vertical .btn:first-child {
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}

.btn-group-vertical .btn:last-child {
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    border-bottom: none;
}

/* Info panel styling */
.info-panel {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
}

.land-info .row {
    font-size: 0.9rem;
}

.land-info .col-5 {
    color: #495057;
}

.land-info .col-7 {
    color: #212529;
    word-break: break-word;
}

/* View mode toggle styling */
.view-mode-toggle .btn {
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.3);
}

.view-mode-toggle .btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.view-mode-toggle .btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: #212529;
}

/* Responsive design */
@media (max-width: 768px) {
    .control-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        max-width: none;
        border-radius: 0;
        z-index: 1001;
    }
    
    .view-mode-toggle {
        top: auto;
        bottom: 10px;
        right: 10px;
    }
    
    .info-panel {
        left: 10px;
        right: 10px;
        bottom: 70px;
        max-width: none;
    }
}

/* Checkbox and radio button styling */
.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.form-check-input:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Custom scrollbar for info panel */
.info-panel::-webkit-scrollbar {
    width: 6px;
}

.info-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.info-panel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.info-panel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Toast messages */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

.loading-content {
    text-align: center;
    color: white;
}

/* Error states */
.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.success-message {
    color: #198754;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Cesium viewer customizations */
.cesium-viewer-toolbar {
    display: none;
}

.cesium-viewer-bottom {
    display: none;
}

/* Credits customization */
.cesium-widget-credits {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
}

/* Selection indicator customization */
.cesium-selection-wrapper {
    pointer-events: none;
}

/* Info box styling if needed */
.cesium-infoBox {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

/* Gallery styles */
.gallery-modal-content {
    padding: 10px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.gallery-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    transition: transform 0.2s ease;
    display: block;
    text-decoration: none;
}

.gallery-item:hover {
    transform: scale(1.05);
    z-index: 10;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s ease;
}

.gallery-item:hover img {
    opacity: 0.9;
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-title {
    color: white;
    font-size: 12px;
    font-weight: 500;
}

/* Audio player styles */
.audio-player-content {
    padding: 15px;
}

.audio-player-content h5 {
    margin-bottom: 10px;
    color: #333;
}

/* Hotspot info content */
.hotspot-info-content {
    padding: 10px;
}

.hotspot-info-content h5 {
    margin-bottom: 10px;
    color: #333;
}

/* Utility classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-out {
    animation: fadeOut 0.3s ease-out;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Hotspot cursor styles */
.cesium-viewer {
    cursor: default;
}

.cesium-viewer.hotspot-hover {
    cursor: pointer !important;
}

.cesium-viewer canvas {
    cursor: inherit;
}

/* Force pointer cursor for all clickable elements in Cesium */
.cesium-button {
    cursor: pointer !important;
}

/* Print styles */
@media print {
    .control-panel,
    .view-mode-toggle,
    .info-panel {
        display: none !important;
    }
}