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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: white;
    margin: 0;
    padding: 0;
}

/* Main Container Styles */
#intro {
    text-align: center;
    padding: 1% 2% 0%;
    background: white;
}

#intro h1 {
    color: #2c3e50;
    margin-bottom: 0.2%;
    font-weight: 600;
    font-size: clamp(24px, 3vw, 42px);
}

#intro p {
    color: #5a6c7d;
    font-size: clamp(14px, 1.2vw, 18px);
    margin-bottom: 0;
}

#search-container {
    margin: 30px 0 20px 0;
    display: flex;
    justify-content: center;
    gap: 1%;
    padding: 0 5%;
    background: white;
}

#search-box {
    flex: 1;
    max-width: 600px;
    padding: 0.8%;
    font-size: clamp(14px, 1vw, 16px);
    border: 2px solid #ddd;
    border-radius: 8px;
}

/* Google Places Autocomplete Styling */
.pac-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border-radius: 8px;
    border-top: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-top: 4px;
}

.pac-item {
    padding: 12px;
    cursor: pointer;
    border-top: 1px solid #e8e8e8;
    font-size: 14px;
}

.pac-item:hover {
    background-color: #f0f2f5;
}

.pac-item-selected,
.pac-item-selected:hover {
    background-color: #f0f8f4;
}

.pac-icon {
    margin-right: 8px;
}

.pac-item-query {
    font-size: 15px;
    color: #2c3e50;
    font-weight: 600;
}

.pac-matched {
    font-weight: 700;
    color: #3a9d5d;
}

#search-button {
    padding: 0.8% 2%;
    min-padding: 12px 30px;
    font-size: clamp(14px, 1vw, 16px);
    cursor: pointer;
    background: linear-gradient(135deg, #52c77a 0%, #3a9d5d 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(82, 199, 122, 0.25);
    white-space: nowrap;
}

#search-button:hover {
    background: linear-gradient(135deg, #45b369 0%, #2d8a4e 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(82, 199, 122, 0.35);
}

#main-container {
    display: flex;
    flex: 1;
    padding: 0 1% 1% 1%;
    gap: 1.5%;
    overflow: hidden;
    width: 100%;
    max-height: calc(100vh - 250px);
    background: white;
    margin-top: 0;
}

#map {
    flex: 1;
    min-height: 350px;
    max-height: calc(100vh - 250px);
    width: 70%;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#playlist {
    width: 28%;
    min-width: 300px;
    max-width: 450px;
    max-height: calc(100vh - 250px);
    padding: 12px;
    background: white;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

#playlist h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-weight: 600;
}

#playlist iframe {
    width: 100%;
    height: 200px;
    margin-bottom: 15px;
    border-radius: 8px;
}

#geolocation {
    padding: 15px;
    background: white;
    border-top: 2px solid #ddd;
    text-align: center;
}

/* Buttons */
.contact-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.contact-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.4);
}

.submit-btn {
    padding: 15px 40px;
    background: linear-gradient(135deg, #52c77a 0%, #3a9d5d 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(82, 199, 122, 0.25);
}

.submit-btn:hover {
    background: linear-gradient(135deg, #45b369 0%, #2d8a4e 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(82, 199, 122, 0.35);
}

.join-btn {
    padding: 18px 45px;
    font-size: 1.1em;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #52c77a 0%, #3a9d5d 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(82, 199, 122, 0.25);
}

.join-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(82, 199, 122, 0.35);
}

.join-btn.secondary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.join-btn.secondary:hover {
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* Success Messages */
.success-message {
    display: none;
    padding: 15px;
    background: #d4edda;
    border: 2px solid #28a745;
    border-radius: 8px;
    color: #155724;
    margin-top: 20px;
}

/* Map Instructions */
.map-instructions {
    background: #e8f5ee;
    padding: 15px;
    border-radius: 8px;
    color: #2d5e3f;
    font-size: 0.95em;
    margin-top: 10px;
    border-left: 4px solid #52c77a;
}

/* Featured Videos Section */
#featured-section {
    max-width: 1400px;
    margin: 40px auto 30px;
    padding: 0 20px;
}

.featured-title {
    font-size: 32px;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 700;
}

.featured-icon {
    font-size: 36px;
    margin-right: 10px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 20px;
}

.featured-video-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.featured-video-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(82, 199, 122, 0.2);
}

.featured-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.featured-thumbnail {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.featured-video-info {
    padding: 20px;
}

.featured-video-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.3;
}

.featured-video-location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #7f8c8d;
    font-size: 15px;
    margin-bottom: 8px;
}

.featured-video-category {
    display: inline-block;
    background: #e8f5ee;
    color: #2d5e3f;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: capitalize;
}

.featured-loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .featured-title {
        font-size: 26px;
    }
}

/* Featured Videos Section */
#featured-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 20px;
}

.featured-video-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.featured-video-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(82, 199, 122, 0.2);
}

.featured-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.featured-thumbnail {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.featured-video-info {
    padding: 20px;
}

.featured-video-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.3;
}

.featured-video-location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #7f8c8d;
    font-size: 15px;
    margin-bottom: 8px;
}

.featured-video-category {
    display: inline-block;
    background: #e8f5ee;
    color: #2d5e3f;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: capitalize;
}

.featured-loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-size: 18px;
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    #featured-videos-grid {
        grid-template-columns: 1fr;
    }
}


/* Video Container for clicked markers */
#sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#video-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#video-container .video-info {
    margin-bottom: 15px;
}

#video-container .video-info h2 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 20px;
}

#video-container .video-category {
    color: #52c77a;
    font-weight: 600;
    margin-bottom: 8px;
}

#video-container .video-description {
    color: #7f8c8d;
    line-height: 1.6;
}

#video-container .video-player {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

#video-container .video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

@media (max-width: 968px) {
    #sidebar {
        width: 100%;
    }
}

/* Welcome Screen */
#welcome-screen {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.welcome-header {
    text-align: center;
    margin-bottom: 25px;
}

.welcome-header h2 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 24px;
}

.welcome-header p {
    color: #7f8c8d;
    margin: 0;
    font-size: 14px;
}

.welcome-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-card {
    background: linear-gradient(135deg, #52c77a 0%, #2ecc71 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: white;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Video List in Playlist */
#video-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.video-card {
    display: flex;
    gap: 12px;
    background: white;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.video-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #52c77a;
}

.video-thumb {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.video-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.video-card-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-card-category {
    color: #52c77a;
    font-size: 12px;
    font-weight: 600;
}

#playlist h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #52c77a;
}

/* Category video items hover effect */
.category-video-item:hover {
    background: white !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateX(2px);
}

@media (max-width: 600px) {
    .video-thumb {
        width: 80px;
        height: 45px;
    }
    
    .video-card-title {
        font-size: 13px;
    }
}

/* Compact Categories Grid (below map) */
#categories-quick-browse {
    background: transparent;
    padding: 5px 20px;
    margin-top: 0px;
    display: flex;
    justify-content: center;
}

.categories-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
    gap: 6px;
    max-width: 1050px;
    justify-content: center;
}

.category-compact-card {
    background: rgba(255, 255, 255, 0.8);
    padding: 6px 3px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    border: none;
    text-align: center;
    min-height: 54px;
    justify-content: center;
}

.category-compact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: rgba(255, 255, 255, 1);
}

.category-compact-card .category-icon {
    font-size: 36px;
    line-height: 1;
}

.category-compact-card .category-name {
    font-size: 9px;
    font-weight: 600;
    color: #424242;
    line-height: 1.1;
}

/* Special styling for Editor's Choice */
.category-compact-card:first-child {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.category-compact-card:first-child:hover {
    background: linear-gradient(135deg, #5568d3 0%, #63408a 100%);
}

.category-compact-card:first-child .category-name {
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .categories-grid-compact {
        grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
        gap: 6px;
    }
    
    .category-compact-card {
        padding: 5px 2px;
        min-height: 50px;
    }
    
    .category-compact-card .category-icon {
        font-size: 32px;
    }
    
    .category-compact-card .category-name {
        font-size: 8px;
    }
}

/* Video Modal/Popup (SkyPixel style) */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.video-modal.active {
    display: block;
}

.video-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.video-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.video-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.video-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.video-modal-player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
}

.video-modal-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-modal-info {
    background: #1a1a1a;
    padding: 20px 30px;
    color: white;
}

.video-modal-info h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
}

.video-modal-info p {
    margin: 0;
    color: #aaa;
    font-size: 14px;
}

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

@keyframes slideUp {
    from {
        transform: translate(-50%, -40%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .video-modal-content {
        width: 95%;
        top: 50%;
    }
    
    .video-modal-info {
        padding: 15px 20px;
    }
    
    .video-modal-info h2 {
        font-size: 18px;
    }
    
    .video-modal-close {
        width: 35px;
        height: 35px;
        font-size: 20px;
        top: 10px;
        right: 10px;
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Capitals icon enhancement */
.category-compact-card img {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.category-compact-card:hover img {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15)) brightness(1.1);
}
