/* General Styles */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background-color: #2c3e50;
    color: #ffffff;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    margin-right: 10px;
}

.logo h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav li {
    margin-left: 20px;
}

.main-nav a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: #3498db;
}

.main-nav a.active {
    color: #3498db;
    border-bottom: 2px solid #3498db;
}

/* Search Section Styles */
.search-section {
    background-color: #34495e;
    padding: 20px 0;
}

.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    position: relative;
}

.search-select {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    background-color: #fff;
    font-size: 16px;
    min-width: 200px;
    outline: none;
}

.search-input {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    min-width: 220px;
    outline: none;
    transition: box-shadow 0.3s;
}

.search-input:focus {
    box-shadow: 0 0 0 2px #3498db;
}

/* Autocomplete styling - Form-like experience */
.autocomplete-active {
    background-color: #ffffff;
    transition: all 0.3s ease;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23999999" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    padding-right: 40px;
}

/* Manual Address Input System */
.address-input-wrapper {
    position: relative;
    margin-bottom: 5px;
    width: 100%;
    flex-grow: 1;
    min-width: 300px;
}

.validate-button {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    height: calc(100% - 8px);
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.validate-button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.address-help-text {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 4px;
    text-align: left;
    padding-left: 2px;
    position: absolute;
    bottom: -20px;
    left: 0;
    width: 100%;
}

.manual-address {
    width: 100%;
    padding-right: 80px; /* Space for validate button */
    flex-grow: 1;
}

.manual-address.active-input {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

.manual-address.validating {
    background-color: #f8f9ff;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%233498db" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>');
    background-repeat: no-repeat;
    background-position: right 80px center;
    background-size: 16px;
    animation: pulse 1.5s infinite;
}

.manual-address.valid-address {
    background-color: #eaffea;
    border-color: #2ecc71;
    transition: all 0.3s ease;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%232ecc71" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><polyline points="22 4 12 14.01 9 11.01"/></svg>');
    background-repeat: no-repeat;
    background-position: right 80px center;
    background-size: 16px;
}

@keyframes highlight-valid {
    0% { background-color: #eaffea; }
    100% { background-color: #ffffff; }
}

/* Custom address helper styling for numeric inputs - keeping for compatibility */
.address-helper-box {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    padding: 12px 15px;
    margin-top: 5px;
    width: 100%;
    position: absolute;
    z-index: 1000;
    animation: slideIn 0.2s ease-out;
}

.helper-title {
    font-weight: 600;
    color: #3498db;
    margin-bottom: 5px;
    font-size: 14px;
}

.helper-suggestion {
    color: #555;
    font-size: 13px;
    line-height: 1.4;
}

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

.search-input.active-autocomplete {
    box-shadow: 0 0 0 2px #3498db, 0 5px 10px rgba(0,0,0,0.1);
    border-color: #3498db;
    background-color: #ffffff;
}

.search-input.has-text {
    color: #2c3e50;
    font-weight: 500;
}

.search-input.geocoding {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%233498db" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><path d="M12 6v6l4 2"></path></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    animation: pulse 1.5s infinite;
}

.search-input.address-selected {
    background-color: #eaf7ff;
    border-color: #3498db;
    animation: highlight-selection 1.5s ease-out;
}

@keyframes highlight-selection {
    0% { background-color: #d4edff; }
    50% { background-color: #eaf7ff; }
    100% { background-color: #ffffff; }
}

.search-input.error {
    border: 1px solid #e74c3c;
    background-color: #ffeaea;
    color: #e74c3c;
    animation: shake 0.5s ease-in-out;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

.search-button {
    padding: 10px 20px;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

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

/* Map Container Styles */
.map-container {
    height: 600px;
    margin: 30px 0;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

#crimeMap {
    width: 100%;
    height: 100%;
}

.map-attribution {
    text-align: center;
    font-size: 12px;
    color: #777;
    margin-bottom: 20px;
}

.map-attribution a {
    color: #3498db;
    text-decoration: none;
}

/* Crime Legend Styles */
.crime-legend {
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    margin: 10px;
    max-width: 200px;
}

.crime-legend h4 {
    margin: 0 0 10px 0;
    font-weight: 500;
    font-size: 16px;
    text-align: center;
}

.map-legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.map-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
    display: inline-block;
}

/* Featured Videos Section Styles */
.featured-videos-section {
    margin: 40px auto;
}

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

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: #2c3e50;
}

.view-all {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.featured-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Video Gallery Styles */
.videos-section {
    margin: 40px auto;
}

.video-tags-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.video-tag-filter {
    padding: 5px 10px;
    background-color: #eaeaea;
    border-radius: 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.video-tag-filter:hover {
    background-color: #d5d5d5;
}

.video-tag-filter.active {
    background-color: #3498db;
    color: #fff;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Video Card Styles */
.video-card {
    background-color: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background-color: #eee;
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.video-details {
    padding: 15px;
}

.video-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #777;
}

.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s;
}

.video-card:hover .video-play-overlay {
    opacity: 1;
}

.video-play-button {
    width: 60px;
    height: 60px;
    background-color: rgba(52, 152, 219, 0.9);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-play-button::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 15px solid #fff;
    margin-left: 5px;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 30px;
}

.load-more-button {
    padding: 10px 20px;
    background-color: #fff;
    color: #3498db;
    border: 2px solid #3498db;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.load-more-button:hover {
    background-color: #3498db;
    color: #fff;
}

/* Video Modal */
.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.8);
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 5% auto;
    width: 90%;
    max-width: 800px;
    border-radius: 4px;
    overflow: hidden;
    animation: modalOpen 0.3s;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    text-shadow: 0 0 3px rgba(0,0,0,0.5);
}

.video-player {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    background-color: #000;
}

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

.modal .video-details {
    padding: 20px;
}

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

.video-description {
    font-size: 16px;
    line-height: 1.5;
    color: #555;
}

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

/* Loading Indicator */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0s 0.3s;
}

.loader.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s, visibility 0s;
}

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

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

/* No Results Message */
.no-results-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 10;
}

/* Crime Popup Styles */
.crime-popup {
    max-width: 300px;
}

.crime-popup-header {
    background-color: #2c3e50;
    color: #fff;
    padding: 10px;
    font-weight: 500;
    border-radius: 4px 4px 0 0;
}

.crime-popup-content {
    padding: 10px;
}

.crime-popup-detail {
    margin-bottom: 5px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .main-nav {
        margin-top: 15px;
    }
    
    .main-nav ul {
        justify-content: center;
    }
    
    .search-select,
    .search-input {
        min-width: 0;
        width: 100%;
    }
    
    .map-container {
        height: 400px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

/* Google Places Autocomplete Customization - Form-like design */
.pac-container {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    margin-top: 4px;
    font-family: 'Roboto', sans-serif;
    padding: 6px 0;
    z-index: 1100 !important;
    animation: fade-in 0.2s ease-out;
    overflow: hidden;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pac-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
}

.pac-item:hover {
    background-color: #f5f9ff;
    border-left-color: #3498db;
}

.pac-item-selected {
    background-color: #e8f0fe;
    border-left-color: #3498db;
}

.pac-icon {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    background-position: center;
    background-size: contain;
}

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

.pac-matched {
    font-weight: 700;
    color: #3498db;
}

.pac-secondary-text {
    font-size: 13px;
    color: #7f8c8d;
}

/* Address form field style overrides */
.search-input:focus {
    box-shadow: 0 0 0 2px #3498db, 0 5px 10px rgba(0,0,0,0.1);
    outline: none;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

/* Additional form-like styling */
.search-input::placeholder {
    color: #95a5a6;
    font-style: italic;
    transition: color 0.3s ease;
}

.search-input:focus::placeholder {
    color: #bdc3c7;
}

/* Responsive fixes for autocompete dropdown */
@media (max-width: 768px) {
    .pac-container {
        width: calc(100% - 40px) !important;
        left: 20px !important;
    }
}
