/* ===== SHOT PLANNER - 3D Terrain Viewer ===== */

/* Main container and section */
#shot-planner-container {
    width: 100%;
}

#shot-planner-section {
    width: 100%;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    margin: 0;
}

#shot-planner-section.expanded {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    border-radius: 0;
    z-index: 9999;
    margin: 0;
}

/* Section header */
.sp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #ede4d9;
    background: #fbf6f0;
    cursor: pointer;
    user-select: none;
}

.sp-section-header h3 {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: #1c1c1c;
    margin: 0;
    flex: 1;
}

#shot-planner-expand-btn {
    background: var(--color-primary, #D4922A);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

#shot-planner-expand-btn:hover {
    background: #c17f1f;
}

#shot-planner-expand-btn:active {
    transform: scale(0.98);
}

/* Cesium viewer container */
#cesium-viewer-container {
    width: 100%;
    height: 400px;
    background: #e5e7eb;
    position: relative;
    overflow: hidden;
}

#shot-planner-section.expanded #cesium-viewer-container {
    height: calc(100vh - 60px);
}

/* Camera HUD - floating overlay */
.sp-camera-hud {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.85rem;
    font-family: var(--font-body, 'Inter', sans-serif);
    z-index: 100;
    min-width: 220px;
}

.sp-hud-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.sp-hud-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.sp-hud-label {
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sp-hud-value {
    color: #1c1c1c;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.sp-hud-select {
    padding: 0.5rem;
    border: 1px solid #ede4d9;
    border-radius: 6px;
    background: white;
    font-size: 0.85rem;
    color: #1c1c1c;
    cursor: pointer;
    font-family: var(--font-body, 'Inter', sans-serif);
}

.sp-hud-select:focus {
    outline: none;
    border-color: var(--color-primary, #D4922A);
    box-shadow: 0 0 0 3px rgba(212, 146, 42, 0.1);
}

/* Time Scrubber */
.sp-time-scrubber {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.sp-scrubber-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.sp-date-input {
    padding: 0.5rem;
    border: 1px solid #ede4d9;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: var(--font-body, 'Inter', sans-serif);
    cursor: pointer;
}

.sp-date-input:focus {
    outline: none;
    border-color: var(--color-primary, #D4922A);
    box-shadow: 0 0 0 3px rgba(212, 146, 42, 0.1);
}

.sp-time-slider-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 200px;
}

.sp-time-slider {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #ede4d9;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.sp-time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-primary, #D4922A);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sp-time-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-primary, #D4922A);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sp-time-display {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #1c1c1c;
    min-width: 50px;
    text-align: center;
    font-size: 0.9rem;
}

.sp-sun-times {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #6b7280;
    flex-wrap: wrap;
}

.sp-sun-times span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Saved Shots */
.sp-saved-shots {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    max-width: 300px;
}

.sp-saved-shots-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.sp-saved-shots-header h3 {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 0.95rem;
    font-weight: 600;
    color: #1c1c1c;
    margin: 0;
}

.sp-save-btn {
    background: var(--color-primary, #D4922A);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sp-save-btn:hover {
    background: #c17f1f;
}

.sp-shots-strip {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.sp-no-shots {
    color: #9ca3af;
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem 0;
    margin: 0;
}

.sp-shot-card {
    flex: 0 0 auto;
    background: #fbf6f0;
    border: 1px solid #ede4d9;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.sp-shot-card:hover {
    border-color: var(--color-primary, #D4922A);
    box-shadow: 0 4px 8px rgba(212, 146, 42, 0.15);
    transform: translateY(-2px);
}

.sp-shot-thumbnail {
    width: 120px;
    height: 90px;
    background: #e5e7eb;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-shot-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sp-no-thumbnail {
    color: #d1d5db;
    font-size: 0.8rem;
    text-align: center;
}

.sp-shot-info {
    padding: 0.5rem;
    position: relative;
}

.sp-shot-info h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1c1c1c;
    margin: 0 0 0.25rem 0;
    word-break: break-word;
    padding-right: 1.5rem;
}

.sp-shot-info p {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
}

.sp-shot-delete {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.sp-shot-delete:hover {
    background: rgb(220, 38, 38);
}

/* Login prompt */
.sp-login-prompt {
    background: #fbf6f0;
    border: 1px solid #ede4d9;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.sp-login-prompt p {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0 0 0.75rem 0;
}

.sp-login-btn {
    display: inline-block;
    background: var(--color-primary, #D4922A);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.sp-login-btn:hover {
    background: #c17f1f;
}

/* Error overlay */
.sp-error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 2rem;
    z-index: 50;
}

.sp-error-overlay p {
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.sp-error-overlay a {
    background: var(--color-primary, #D4922A);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease;
}

.sp-error-overlay a:hover {
    background: #c17f1f;
}

/* Responsive design */
@media (max-width: 768px) {
    .sp-section-header {
        padding: 0.75rem;
    }

    .sp-section-header h3 {
        font-size: 1rem;
    }

    #shot-planner-expand-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    #cesium-viewer-container {
        height: 300px;
    }

    #shot-planner-section.expanded #cesium-viewer-container {
        height: calc(100vh - 50px);
    }

    .sp-camera-hud {
        top: 0.75rem;
        right: 0.75rem;
        padding: 0.75rem;
        min-width: 200px;
        font-size: 0.8rem;
    }

    .sp-hud-info {
        gap: 0.5rem;
    }

    .sp-time-scrubber {
        bottom: 0.75rem;
        left: 0.75rem;
        right: 0.75rem;
        padding: 0.75rem;
    }

    .sp-scrubber-controls {
        gap: 0.75rem;
    }

    .sp-time-slider-container {
        min-width: 150px;
    }

    .sp-saved-shots {
        display: none;
    }

    .sp-sun-times {
        gap: 0.5rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    #cesium-viewer-container {
        height: 250px;
    }

    .sp-camera-hud {
        top: 0.5rem;
        right: 0.5rem;
        min-width: 180px;
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    .sp-hud-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .sp-time-scrubber {
        bottom: 0.5rem;
        left: 0.5rem;
        right: 0.5rem;
        padding: 0.5rem;
    }

    .sp-scrubber-controls {
        flex-direction: column;
        gap: 0.5rem;
    }

    .sp-date-input {
        width: 100%;
    }

    .sp-time-slider-container {
        width: 100%;
    }
}

/* Cesium viewer customization */
.cesium-viewer {
    font-family: var(--font-body, 'Inter', sans-serif);
}

.cesium-viewer .cesium-widget-credits {
    background: rgba(0, 0, 0, 0.3);
    font-size: 0.75rem;
}

/* Loading state */
.sp-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.9rem;
}

.sp-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    margin-left: 0.5rem;
    border: 2px solid #ede4d9;
    border-top-color: var(--color-primary, #D4922A);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Print styles */
@media print {
    #shot-planner-section {
        display: none;
    }
}
