/* Base Styles */
body {
    background: #121212;
    color: #ffffff;
    font-family: Arial, sans-serif;
    padding: 0;
    line-height: 1.6;
}

/* Search Container */
.search-container {
    max-width: 1200px;
    margin: 0 auto 30px;
    display: flex;
    gap: 10px;
    padding: 0 20px;
}

#searchInput {
    flex: 1;
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #333;
    border-radius: 6px;
    background: #1a1a1a;
    color: #ffffff;
    transition: border-color 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #0066FF;
}

#searchButton {
    padding: 12px 30px;
    background: #0066FF;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#searchButton:hover {
    background: #0052cc;
}

/* Results Container */
.results-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Parcel Card */
.parcel-card {
    display: flex;
    flex-direction: column;
    padding: 15px;
    margin: 0;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.5);
    position: relative;
    transition: transform 0.3s ease;
}

/* Sharp text styles for all cards */
.parcel-card h2,
.parcel-card .detail-label,
.parcel-card .detail-value {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Text styles for bright backgrounds */
.parcel-card[style*="FFD700"],  /* Yellow/Industrial */
.parcel-card[style*="00FF00"] { /* Green/Commercial */
    & h2,
    & .detail-value {
        color: #000000;
        text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
    }
    
    & .detail-label {
        color: rgba(0, 0, 0, 0.85);
    }
    
    & .parcel-detail {
        border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    }
}

/* Darker background text styles */
.parcel-card[style*="0066FF"], /* Blue/Residential */
.parcel-card[style*="FF4500"], /* Orange/Mixed Use */
.parcel-card[style*="9933CC"] { /* Purple/Legendary */
    & h2,
    & .detail-value {
        color: #FFFFFF;
    }
    
    & .detail-label {
        color: rgba(255, 255, 255, 0.9);
    }
    
    & .parcel-detail {
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
}

.parcel-card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.parcel-card h2 {
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
    color: #ffffff;
    font-size: 24px;
}

/* Card Details */
.parcel-detail {
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
}

.parcel-detail:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.detail-label {
    font-size: 13px;
    color: #909090;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-value {
    font-size: 13px;
    font-weight: 500;
    text-align: right;
}

/* Icons */
.icon {
    font-size: 1.2em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
}

.detail-label .icon:has(💎),
.detail-label .icon:has(🏆) {
    font-size: 1.4em;
}

/* Legend */
.icon-legend {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 20px;
    margin: 0 auto 20px;
    max-width: 1200px;
}

.legend-grid {
    display: flex;
    flex-direction: row;
    gap: 30px;
    flex-wrap: wrap;
}

.legend-section {
    min-width: 200px;
    flex: 1;
}

.legend-section h4 {
    color: #909090;
    font-size: 14px;
    margin-bottom: 10px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

/* Legend Items */
.legend-item {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 4px;
    margin-right: 8px;
    color: white;
    cursor: default;
    user-select: none;
    opacity: 1;
}

.legend-icon {
    font-size: 1.2em;
    width: 30px;
    text-align: center;
}

.legend-text {
    color: #ffffff;
    font-size: 14px;
}

/* Error Message */
.error-message {
    background: rgba(255, 68, 68, 0.1);
    border-left: 4px solid #ff4444;
    color: #ff4444;
    padding: 15px 20px;
    border-radius: 6px;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .results-container {
        grid-template-columns: repeat(2, 1fr);
        padding: 16px;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .results-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .results-container {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 15px;
    }
}

/* Card Header */
.card-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.card-header h2 {
    margin: 0;
    padding: 0;
    border: none;
}

/* Zone Icon */
.zone-icon {
    font-size: 1.8em;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease, filter 0.3s ease;
    cursor: help;
}

.zone-icon:has(💎),
.zone-icon:has(🏆) {
    font-size: 2em;
}

.zone-icon:hover {
    transform: scale(1.2);
    filter: brightness(1.2);
}

.zoning-legend {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    padding: 15px;
    margin: 20px auto;
    max-width: 1200px;
    width: auto;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.legend-title {
    color: #909090;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    padding-right: 20px;
    border-right: 1px solid #333;
}

/* Legend Items Colors */
.legend-item[data-zone="Legendary"] {
    background-color: #9933CC99;
}

.legend-item[data-zone="Mixed Use"] {
    background-color: #FF450099;
}

.legend-item[data-zone="Residential"] {
    background-color: #0066FF99;
}

.legend-item[data-zone="Commercial"] {
    background-color: #00FF0099;
}

.legend-item[data-zone="Industrial"] {
    background-color: #FFD70099;
}

.legend-item[data-zone="Commercial"] .legend-text,
.legend-item[data-zone="Industrial"] .legend-text {
    color: #000000;
}

/* Hero Image */
.hero-image {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content Wrapper */
.content-wrapper {
    position: relative;
    z-index: 2;
    padding: 20px;
    margin-top: 60px; /* Add this line to create space below the nav */
}

/* Update the search-container styles (around line 386) */
.search-container {
    max-width: 1200px;
    margin: 20px auto 30px; /* Adjusted margin */
    display: flex;
    gap: 10px;
    background: rgba(30, 30, 30, 0.8);
    padding: 20px;
    border-radius: 8px;
    position: relative; /* Add this */
    z-index: 3; /* Add this */
}
/* Filter Styles */
.filter-dropdown-container {
    position: relative;
    min-width: 200px;
}

.filter-button {
    background: rgba(30, 30, 30, 0.8);
    color: white;
    padding: 8px 12px;
    border: 1px solid #333;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    position: relative;
}

.filter-button:after {
    content: '▼';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
}

.filter-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 8px 0;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    width: 200px;
    margin-top: 4px;
    display: none;
}


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

/* Card Actions */
.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    color: inherit;
}

.download-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.1);
}

/* Typewriter base styles (desktop) */
.typewriter-container {
    position: fixed;
    top: 20px;
    left: 20px;
    transform: none;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    padding: 20px;
    border-radius: 10px;
    max-width: 400px;
    max-height: 80vh;
}

.typewriter {
    position: relative;
    white-space: pre-line;
    font-family: monospace;
    color: #00FF00;
    font-size: 14px;
    line-height: 1.4;
}

.typewriter-content {
    color: #00FF00;
}

.typewriter-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #00FF00;
    cursor: pointer;
    font-size: 20px;
    opacity: 0.8;
}

.typewriter-close:hover {
    opacity: 1;
}

.typewriter-close:before {
    content: "×";
}

.typewriter.hidden {
    display: none;
}

/* Add scrollbar styling */
.typewriter-container::-webkit-scrollbar {
    width: 8px;
}

.typewriter-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.typewriter-container::-webkit-scrollbar-thumb {
    background: #00FF00;
    border-radius: 4px;
}

/* Mobile styles */
@media (max-width: 768px) {
    .typewriter-container {
        display: none !important; /* Force hide on mobile */
    }
}

/* Hide styles */
.typewriter-container.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
    /* Search container improvements */
    .search-container {
        flex-direction: column;
        padding: 15px;
        margin: 10px;
    }

    #searchInput {
        width: 100%;
        font-size: 14px;
        padding: 10px 15px;
    }

    #searchButton {
        width: 100%;
        padding: 10px;
    }

    /* Legend improvements */
    .zoning-legend {
        background: rgba(0, 0, 0, 0.9);
        margin: 10px;
        padding: 12px;
    }

    .legend-items {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .legend-item {
        padding: 6px 8px;
        font-size: 12px;
    }

    .legend-icon {
        font-size: 16px;
    }

    /* Parcel card improvements */
    .parcel-card {
        padding: 12px;
        font-size: 13px;
    }

    .card-header h2 {
        font-size: 18px;
    }

    /* Typewriter improvements */
    .typewriter-container {
        bottom: 10px;
        left: 10px;
        width: calc(100% - 20px);
        max-width: none;
    }

    .typewriter {
        padding: 15px;
        font-size: 11px;
    }

    .typewriter-close {
        top: 5px;
        right: 5px;
        width: 28px;
        height: 28px;
        background: rgba(0, 0, 0, 0.8);
        border: 1px solid #00ff00;
        color: #00ff00;
        font-size: 20px;
    }

    /* Filter improvements */
    .filter-dropdown-container {
        width: 100%;
    }

    .filter-menu {
        width: 100%;
        max-height: 300px;
    }
}

/* Even smaller screens */
@media (max-width: 380px) {
    .legend-items {
        grid-template-columns: 1fr;
    }
}

/* Make sure cards don't stretch too wide */
@media (min-width: 1201px) {
    .results-container {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) and (min-width: 769px) {
    .results-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .results-container {
        grid-template-columns: repeat(1, 1fr);
    }
}

.hologram-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;
    perspective: 1000px;
}

.hologram-image {
    position: absolute;
    width: 120%;
    height: 120%;
    top: -10%;
    left: -10%;
    object-fit: cover;
    filter: 
        brightness(1.1)
        contrast(1.1)
        drop-shadow(0 0 8px rgba(0, 255, 255, 0.3));
    transform-style: preserve-3d;
    animation: hologramFloat 4s ease-in-out infinite;
}

.hologram-glitch {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(0, 255, 255, 0.1) 50%,
        transparent 100%
    );
    animation: hologramGlitch 3s infinite linear;
}

/* Show hologram on hover */
.parcel-card:hover .hologram-overlay {
    opacity: 1;
    transform: scale(1.05) translateY(-10px);
}

.parcel-card:hover .card-content {
    opacity: 0.15;
}

@keyframes hologramFloat {
    0%, 100% {
        transform: 
            translateZ(0) 
            rotateX(0deg) 
            rotateY(0deg);
    }
    50% {
        transform: 
            translateZ(30px) 
            rotateX(2deg) 
            rotateY(-2deg);
    }
}

@keyframes hologramGlitch {
    0% {
        transform: translateX(-100%) skewX(-45deg);
    }
    100% {
        transform: translateX(200%) skewX(-45deg);
    }
}

/* Add scanline effect */
.hologram-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 255, 0.05) 0%,
        rgba(0, 255, 255, 0.05) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
}

.toast-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 1000;
    animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(20px); }
    10% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

.nft-count {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    margin: 10px auto;
    text-align: center;
    max-width: 300px;
}

/* Analytics Styles */
#searchResults {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 12px;
}

.nft-count {
    text-align: center;
    color: #eaebf0;
    font-size: 18px;
    margin-bottom: 20px;
}

.analytics-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    height: calc(100vh - 100px);
    background: rgba(9, 9, 9, 0.932);
    padding: 20px;
    border-radius: 8px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;  /* Add this to establish positioning context */
}

.analytics-button {
    width: 200px;
    margin: 20px auto 0;
    display: block;
    padding: 12px 24px;
    background: #0066FF;
    color: rgb(6, 6, 6);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.analytics-close-btn {
    position: absolute;  /* Change from fixed to absolute */
    top: 20px;          /* Adjust to position from top of container */
    right: 20px;        /* Adjust to position from right of container */
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.analytics-button:hover {
    background: #0052cc;
}

.zone-distribution {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.zone-stat {
    flex: 1;
    min-width: 150px;
    max-width: 200px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #searchResults {
        margin: 15px;
        padding: 15px;
    }

    .analytics-button {
        width: 160px;
    }
}

.analytics-section {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.transfer-history {
    max-height: 300px;
    overflow-y: auto;
}

.transfer-item {
    margin: 10px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.transfer-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: #888;
    margin-top: 5px;
}

.transfer-item a:hover {
    color: #fff !important;
    text-decoration: underline !important;
}

.transfer-history {
    scrollbar-width: thin;
    scrollbar-color: #666 #333;
}

.transfer-history::-webkit-scrollbar {
    width: 8px;
}

.transfer-history::-webkit-scrollbar-track {
    background: #333;
    border-radius: 4px;
}

.transfer-history::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 4px;
}

.transfer-history::-webkit-scrollbar-thumb:hover {
    background: #888;
}

.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9); /* Slightly more opaque */
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); /* Add subtle shadow */
    height: 60px; /* Fixed height */
    display: flex;
    align-items: center;
}

.nav-links {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 16px;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    background: transparent; /* Ensure transparent background */
}

/* Style for the analytics button specifically */
#analytics-btn.nav-link {
    background: transparent; /* Override any default button styles */
    border: none;
    color: white;
    cursor: pointer;
    font-family: inherit;
    padding: 8px 16px;
}

/* Hover effects */
.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}


.analytics-content {
    max-width: 1200px;
    margin: 0 auto;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

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

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

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    padding: 20px;
}

.chart-grid > div {
    min-height: 350px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 20px;
}

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid #ffffff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    color: #ffffff;
    text-align: center;
    font-size: 16px;
}

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

.analytics-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.analytics-modal {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 20px;
    width: 1200px;  /* Fixed width */
    max-width: 90%;  /* Fallback for mobile */
    max-height: 100vh;
    position: relative;
    margin: 20px;
}

/* Update this CSS block around line 1102 */
.analytics-close-btn {
    position: absolute; /* Change from fixed to absolute */
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.analytics-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

.analytics-header h2 {
    color: #fff;
    font-size: 24px;
    font-weight: 500;
}