/**
 * CODDB Maps Page - Battlefield Intelligence System
 * Tactical styling with military/intelligence theme
 */

/* Main Page Layout */
.coddb-maps-page {
    background: linear-gradient(135deg, #0a0f1c 0%, #1a1f2e 50%, #0d1421 100%);
    min-height: 100vh;
    color: #e0e6ed;
}

/* ===== HERO SECTION ===== */
.coddb-page-hero {
    position: relative;
    height: 60vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 80px;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 102, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 255, 0, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #0f1419 0%, #1a252f 100%);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(255, 102, 0, 0.03) 50%, transparent 70%),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 100px,
            rgba(255, 255, 255, 0.01) 101px,
            rgba(255, 255, 255, 0.01) 102px
        );
}

.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255, 102, 0, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(0, 255, 0, 0.3), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.2), transparent);
    background-repeat: repeat;
    background-size: 150px 150px, 200px 200px, 100px 100px;
    animation: particleFloat 20s linear infinite;
}

@keyframes particleFloat {
    0% { transform: translateY(0px) translateX(0px); }
    33% { transform: translateY(-20px) translateX(10px); }
    66% { transform: translateY(-10px) translateX(-5px); }
    100% { transform: translateY(0px) translateX(0px); }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    padding: 0 20px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 102, 0, 0.1);
    border: 1px solid rgba(255, 102, 0, 0.3);
    border-radius: 50px;
    padding: 8px 20px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.badge-icon {
    font-size: 16px;
}

.badge-text {
    font-size: 14px;
    font-weight: 600;
    color: #ff6600;
    letter-spacing: 1px;
}

.hero-title {
    margin: 0 0 30px 0;
}

.title-main {
    display: block;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    line-height: 1.1;
    background: linear-gradient(135deg, #ffffff 0%, #ff6600 50%, #00ff00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.title-sub {
    display: block;
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 2px;
}

.hero-description {
    font-size: 1.2rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 40px 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #ff6600;
    line-height: 1;
    margin-bottom: 5px;
    font-family: 'Orbitron', monospace;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* ===== MAPS CONTROLS ===== */
.coddb-maps-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.coddb-maps-controls {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 40px;
}

.controls-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 25px;
    align-items: center;
}

/* Search Section */
.search-section {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 50px 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 102, 0, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #ff6600;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
    background: rgba(255, 255, 255, 0.08);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-icon {
    position: absolute;
    right: 15px;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

.search-clear {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.search-clear:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff6600;
}

/* Filter Section */
.filter-section {
    position: relative;
}

.filter-dropdown {
    position: relative;
}

.filter-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 102, 0, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
}

.filter-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #ff6600;
}

.filter-arrow {
    transition: transform 0.3s ease;
    margin-left: auto;
}

.filter-dropdown.active .filter-arrow {
    transform: rotate(180deg);
}

.filter-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(20, 25, 35, 0.95);
    border: 1px solid rgba(255, 102, 0, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
    margin-top: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.filter-dropdown.active .filter-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-option:last-child {
    border-bottom: none;
}

.filter-option:hover {
    background: rgba(255, 102, 0, 0.1);
}

.filter-option.active {
    background: rgba(255, 102, 0, 0.2);
    color: #ff6600;
}

.option-count {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* View Section */
.view-section {
    display: flex;
    gap: 15px;
    align-items: center;
}

.view-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.view-option {
    background: none;
    border: none;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.view-option.active {
    background: #ff6600;
    color: #ffffff;
}

.sort-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 102, 0, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    color: #ffffff;
    cursor: pointer;
    min-width: 160px;
}

.sort-select option {
    background: #1a252f;
    color: #ffffff;
}

/* ===== LOADING INDICATOR ===== */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 60px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 102, 0, 0.2);
    border-top: 3px solid #ff6600;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
}

/* ===== MAPS GRID ===== */
.coddb-maps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* ===== LOAD MORE SECTION ===== */
.load-more-section {
    text-align: center;
    padding: 40px 20px;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #ff6600 0%, #ff8533 100%);
    border: none;
    border-radius: 8px;
    padding: 15px 30px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 102, 0, 0.3);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-loading {
    display: none;
}

.load-more-btn.loading .btn-text,
.load-more-btn.loading .btn-icon {
    opacity: 0;
}

.load-more-btn.loading .btn-loading {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===== NO RESULTS ===== */
.no-results {
    text-align: center;
    padding: 80px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results-title {
    font-size: 1.8rem;
    margin: 0 0 10px 0;
    color: #ffffff;
}

.no-results-text {
    font-size: 1.1rem;
    margin: 0 0 30px 0;
    opacity: 0.8;
}

.reset-filters-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 102, 0, 0.1);
    border: 1px solid rgba(255, 102, 0, 0.3);
    border-radius: 8px;
    padding: 12px 24px;
    color: #ff6600;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-filters-btn:hover {
    background: rgba(255, 102, 0, 0.2);
    border-color: #ff6600;
}

/* ===== MAP CARDS ===== */

.maps-grid.list-view {
    grid-template-columns: 1fr;
}

/* Map Card */
.map-card {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(20, 10, 0, 0.4) 100%);
    border: 1px solid rgba(255, 102, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
}

.map-card:hover {
    transform: translateY(-5px);
    border-color: #ff6600;
    box-shadow: 0 10px 30px rgba(255, 102, 0, 0.2);
}

/* Game-specific card styling */
.map-card[data-game="MWII"] {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 20, 0, 0.4) 100%);
    border-color: rgba(0, 255, 0, 0.2);
}

.map-card[data-game="MWII"]:hover {
    border-color: #00ff00;
    box-shadow: 0 10px 30px rgba(0, 255, 0, 0.2);
}

.map-card[data-game="MWIII"] {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(20, 0, 0, 0.4) 100%);
    border-color: rgba(255, 0, 0, 0.2);
}

.map-card[data-game="MWIII"]:hover {
    border-color: #ff0000;
    box-shadow: 0 10px 30px rgba(255, 0, 0, 0.2);
}

.map-preview {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a252f 0%, #0f1419 100%);
}

.map-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    opacity: 0;
}

.map-image.loaded {
    opacity: 1;
}

.map-card:hover .map-image {
    transform: scale(1.05);
}

.game-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 102, 0, 0.9);
    color: #000;
    padding: 6px 12px;
    border-radius: 15px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Game-specific badge colors */
.map-card[data-game="MWII"] .game-badge {
    background: rgba(0, 255, 0, 0.9);
    color: #000;
}

.map-card[data-game="MWIII"] .game-badge {
    background: rgba(255, 0, 0, 0.9);
    color: #fff;
}

.map-image-fallback {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a252f 0%, #0f1419 100%);
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    text-align: center;
    line-height: 1.4;
}

/* Map Info */
.map-info {
    padding: 20px;
}

.map-name {
    font-family: 'Orbitron', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    color: #ff6600;
    margin: 0 0 8px 0;
    text-shadow: 0 0 5px rgba(255, 102, 0, 0.3);
}

/* Game-specific name colors */
.map-card[data-game="MWII"] .map-name {
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

.map-card[data-game="MWIII"] .map-name {
    color: #ff0000;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.3);
}

.map-code {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    color: rgba(224, 230, 237, 0.6);
    margin: 0 0 15px 0;
    letter-spacing: 0.5px;
}

.map-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 102, 0, 0.2);
}

/* Game-specific meta borders */
.map-card[data-game="MWII"] .map-meta {
    border-top: 1px solid rgba(0, 255, 0, 0.2);
}

.map-card[data-game="MWIII"] .map-meta {
    border-top: 1px solid rgba(255, 0, 0, 0.2);
}

.map-hash {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: rgba(224, 230, 237, 0.5);
    background: rgba(255, 102, 0, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Game-specific hash backgrounds */
.map-card[data-game="MWII"] .map-hash {
    background: rgba(0, 255, 0, 0.1);
}

.map-card[data-game="MWIII"] .map-hash {
    background: rgba(255, 0, 0, 0.1);
}

.map-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: #ff6600;
}

/* Game-specific status colors */
.map-card[data-game="MWII"] .map-status {
    color: #00ff00;
}

.map-card[data-game="MWIII"] .map-status {
    color: #ff0000;
}

/* Modal Styles */
.tactical-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tactical-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.modal-container {
    position: relative;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 20, 0, 0.8) 100%);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 15px;
    max-width: 800px;
    max-height: 90vh;
    width: 90%;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
    background: rgba(0, 255, 0, 0.05);
}

.modal-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: #00ff00;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(224, 230, 237, 0.6);
    cursor: pointer;
    font-size: 24px;
    padding: 5px;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #ff6b6b;
}

.modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: rgba(224, 230, 237, 0.6);
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    margin: 0 0 10px 0;
    color: rgba(224, 230, 237, 0.8);
}

.no-results p {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    margin: 0;
}

/* Load More */
.load-more-section {
    text-align: center;
    padding: 40px 20px;
}

.load-more-btn {
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.2) 0%, rgba(0, 200, 0, 0.1) 100%);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 25px;
    padding: 15px 30px;
    color: #00ff00;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
}

.load-more-btn:hover {
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.3) 0%, rgba(0, 200, 0, 0.2) 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 0, 0.2);
}

.load-more-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .controls-wrapper {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .coddb-maps-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .title-main {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }
    
    .hero-stats {
        gap: 20px;
    }
    
    .modal-container {
        width: 95%;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .coddb-page-hero {
        padding: 40px 15px;
        min-height: 400px;
    }
    
    .title-main {
        font-size: clamp(1.8rem, 10vw, 2rem);
    }
    
    .hero-stats {
        gap: 15px;
        flex-direction: column;
    }
    
    .coddb-maps-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

/* Accessibility */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #00ff00;
    color: #000;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    z-index: 100;
    transition: top 0.3s ease;
}

.skip-to-content:focus {
    top: 6px;
}

/* Custom Scrollbar */
.filter-menu::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.filter-menu::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.filter-menu::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 0, 0.5);
    border-radius: 3px;
}

.filter-menu::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 0, 0.7);
}
