/* Main Stylesheet for Dirt Dudes Excavating */

body {
    font-family: 'Manrope', sans-serif;
}

h1, h2, h3, .heading-font {
    font-family: 'Oswald', sans-serif;
}

/* Scrollbar Hiding */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Custom Slider Thumb */
input[type=range]::-webkit-slider-thumb {
    pointer-events: all;
    width: 32px;
    height: 32px;
    -webkit-appearance: none;
    background-color: #FFC107;
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    cursor: ew-resize;
}

input[type=range]::-moz-range-thumb {
    pointer-events: all;
    width: 32px;
    height: 32px;
    -moz-appearance: none;
    background-color: #FFC107;
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    cursor: ew-resize;
}

/* Map Marker Animation */
@keyframes pulse-ring {
    0% {
        transform: scale(0.33);
        opacity: 0.8;
    }
    80%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

.marker-pulse::before {
    content: '';
    position: absolute;
    left: -50%;
    top: -50%;
    width: 200%;
    height: 200%;
    border-radius: 50%;
    background-color: inherit;
    opacity: 0.4;
    animation: pulse-ring 2.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

/* Title Animation Utilities */
.clip-text-line {
    overflow: hidden;
    display: block;
    line-height: 0.95;
    padding-bottom: 0.2em; /* Prevent descender clipping */
    margin-bottom: -0.2em;
}

.reveal-text {
    display: block;
    transform: translateY(100%);
    will-change: transform;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Form Styles */
input:focus, textarea:focus {
    outline: none;
}

/* Mobile Menu Animation */
#mobile-menu {
    transition: transform 0.3s ease-in-out;
}

#mobile-menu.open {
    transform: translateX(0);
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Hero Video Background */
#hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: bottom;
    z-index: 1;
    transition: opacity 0.5s ease-in-out;
}

/* Enhanced text readability for hero section */
main h1,
main .text-stone-700,
main .text-stone-600 {
    position: relative;
    z-index: 10;
}

/* Success/Error Messages */
.form-message {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.form-message.success {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #10B981;
}

.form-message.error {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #EF4444;
}

/* Map Interactive Styles */
.project-list-item.active {
    background-color: #1f1f1f;
}

.project-list-item.inactive {
    background-color: transparent;
}

.project-list-item:hover {
    background-color: #1f1f1f;
}

.project-popup {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-100% - 10px));
    }
    to {
        opacity: 1;
        transform: translate(-50%, calc(-100% - 20px));
    }
}

.map-marker {
    transition: transform 0.2s ease-out;
}

.map-marker:hover {
    transform: translate(-50%, -50%) scale(1.3) !important;
    z-index: 25 !important;
}

/* Leaflet Map Custom Styles */
#map-container {
    z-index: 1;
    width: 100%;
    height: 100%;
}

.leaflet-container {
    background: #121212 !important;
    font-family: inherit;
}

/* Dark map theme adjustments */
.leaflet-container .leaflet-control-attribution {
    background: rgba(26, 26, 26, 0.8) !important;
    color: #a3a3a3 !important;
    font-size: 10px !important;
    padding: 4px 8px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.leaflet-container .leaflet-control-attribution a {
    color: #FFC107 !important;
}

/* Summary card text truncation */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.custom-zoom-controls {
    background: rgba(26, 26, 26, 0.95) !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px;
    overflow: hidden;
}

.custom-zoom-controls a {
    background: transparent !important;
    color: white !important;
    border: none !important;
    width: 40px !important;
    height: 40px !important;
    line-height: 40px !important;
    transition: background 0.2s;
}

.custom-zoom-controls a:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.custom-zoom-controls .leaflet-control-zoom-in,
.custom-zoom-controls .leaflet-control-zoom-out {
    font-size: 18px !important;
    font-weight: bold;
}

/* Custom Marker Styles */
.custom-marker {
    background: transparent !important;
    border: none !important;
}

.marker-container {
    position: relative;
    width: 24px;
    height: 24px;
}

.marker-pin {
    width: 24px;
    height: 24px;
    background: var(--marker-color, #FFC107);
    border: 3px solid white;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.6);
    position: relative;
    z-index: 2;
}

.marker-container.active .marker-pin {
    animation: markerPulse 2s infinite;
}

.marker-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 24px;
    height: 24px;
    background: var(--marker-color, #FFC107);
    border-radius: 50%;
    opacity: 0.6;
    animation: pulseRing 2s infinite;
    z-index: 1;
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes markerPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255, 193, 7, 0.6);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 193, 7, 0.9);
    }
}

/* Popup Styles */
.leaflet-popup-content-wrapper {
    background: #1a1a1a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    padding: 0 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    padding: 0 !important;
}

.popup-content {
    padding: 24px;
    color: white;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.popup-title-section {
    flex: 1;
}

.popup-title {
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    color: white;
    margin: 0 0 4px 0;
}

.popup-address {
    font-size: 11px;
    color: #a3a3a3;
    margin: 0 0 4px 0;
    font-family: monospace;
}

.popup-id {
    font-size: 10px;
    color: #737373;
    margin: 0;
    font-family: monospace;
}

.popup-close {
    background: transparent;
    border: none;
    color: #a3a3a3;
    cursor: pointer;
    padding: 4px;
    margin-left: 12px;
    transition: color 0.2s;
}

.popup-close:hover {
    color: white;
}

.popup-status {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.status-badge,
.type-badge {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid;
}

.type-badge {
    color: #a3a3a3;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.popup-progress {
    margin-bottom: 16px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    margin-bottom: 8px;
}

.progress-label {
    color: #a3a3a3;
    font-weight: bold;
    text-transform: uppercase;
}

.progress-value {
    color: white;
    font-weight: bold;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #262626;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.popup-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 8px;
}

.stat-label {
    display: block;
    font-size: 10px;
    color: #a3a3a3;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 16px;
    color: white;
    font-weight: bold;
    font-family: monospace;
}

.popup-features {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
}

.features-title {
    font-size: 11px;
    font-weight: bold;
    color: #a3a3a3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 193, 7, 0.2);
}

.feature-icon {
    color: #FFC107;
    flex-shrink: 0;
    margin-top: 2px;
}

.feature-text {
    font-size: 12px;
    color: #e5e5e5;
    line-height: 1.4;
}

.feature-icon-small {
    color: #FFC107;
    flex-shrink: 0;
}

.category-badge {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid;
    color: #FFC107;
    border-color: rgba(255, 193, 7, 0.3);
    background: rgba(255, 193, 7, 0.1);
}

.category-filter-btn {
    transition: all 0.2s ease;
}

.category-filter-btn.active {
    background: rgba(255, 193, 7, 0.2) !important;
    border-color: rgba(255, 193, 7, 0.3) !important;
    color: white !important;
}

.category-filter-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 193, 7, 0.2);
}

.leaflet-popup-tip {
    background: #1a1a1a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.leaflet-popup-close-button {
    display: none !important;
}

/* Directions Button Styles */
.popup-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.directions-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: #FFC107;
    color: #1a1a1a;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.directions-btn:hover {
    background: #FFA000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.directions-btn svg {
    flex-shrink: 0;
}

.directions-btn-list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: #FFC107;
    color: #1a1a1a;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.directions-btn-list:hover {
    background: #FFA000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.directions-btn-list svg {
    flex-shrink: 0;
}

/* Project Navigation Arrows */
#prev-project-btn,
#next-project-btn,
#prev-summary-btn,
#next-summary-btn {
    transition: opacity 0.3s ease, transform 0.2s ease, background 0.2s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#prev-project-btn:hover,
#next-project-btn:hover,
#prev-summary-btn:hover,
#next-summary-btn:hover {
    transform: scale(1.15);
    background: #FFC107 !important;
}

/* Ensure scrollable containers work properly */
#project-list,
#summary-view .overflow-y-auto {
    scroll-behavior: smooth;
}

/* Gallery Page Styles */
.gallery-filter-btn {
    color: #78716c;
    background: transparent;
    border: 1px solid #e7e5e4;
}

.gallery-filter-btn:hover {
    background: #f5f5f4;
    border-color: #d6d3d1;
    color: #1a1a1a;
}

.gallery-filter-btn.active {
    background: #FFC107;
    color: #1a1a1a;
    border-color: #FFC107;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.gallery-item {
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
}

.gallery-lightbox {
    backdrop-filter: blur(8px);
}

.gallery-lightbox img {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* About Section Image Cycling */
.about-cycle-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    filter: grayscale(100%);
    z-index: 1;
}

.about-cycle-image:hover {
    filter: grayscale(0%);
}

.about-cycle-image.active {
    opacity: 1;
    z-index: 2;
}
