@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root { 
    /* Silver/Metallic Color Palette */
    --primary-color: #ffffff;
    --secondary-color: rgba(20, 20, 25, 0.95);
    --accent-color: #71717a;
    --accent-hover: #a1a1aa;
    --text-color: #f3f4f6;
    --text-secondary: #9ca3af;
    --card-background: rgba(30, 30, 35, 0.8);
    --card-hover: rgba(40, 40, 45, 0.9);
    --border-color: rgba(113, 113, 122, 0.2);
    --transition-speed: 0.4s;
    --border-radius: 12px;
    --max-width: 100vw;
    --glass-blur: 20px;
    --glow-color: #d4d4d8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: 
        radial-gradient(ellipse at top left, rgba(113, 113, 122, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(161, 161, 170, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at center, #0a0a0a 0%, #080808 40%, #000000 100%);
    background-attachment: fixed;
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    animation: subtleShift 20s ease-in-out infinite;
}

@keyframes subtleShift {
    0%, 100% { 
        background-size: 100% 100%, 100% 100%, 100% 100%;
    }
    50% { 
        background-size: 110% 110%, 105% 105%, 100% 100%;
    }
}

/* Enhanced Particle Canvas - Galaxy Effect */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
}

/* Shooting Stars - Silver streaks */
body::before,
body::after {
    content: '';
    position: fixed;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(212, 212, 216, 0.8), transparent);
    box-shadow: 0 0 10px rgba(212, 212, 216, 0.5), 0 0 20px rgba(113, 113, 122, 0.3);
    opacity: 0;
    z-index: 2;
    border-radius: 2px;
}

body::before {
    top: 20%;
    left: -100px;
    animation: shootingStar1 8s infinite;
}

body::after {
    top: 60%;
    right: -100px;
    animation: shootingStar2 8s infinite 4s;
}

@keyframes shootingStar1 {
    0%, 90% {
        opacity: 0;
        transform: translateX(0) translateY(0);
    }
    91% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(calc(100vw + 200px)) translateY(100px);
    }
}

@keyframes shootingStar2 {
    0%, 90% {
        opacity: 0;
        transform: translateX(0) translateY(0) rotate(-15deg);
    }
    91% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(calc(-100vw - 200px)) translateY(-100px) rotate(-15deg);
    }
}

/* Title Row - Button and Title on same row */
.title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    margin-bottom: 12px;
}

/* Back to Home Button */
.back-home-button {
    position: absolute;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    padding: 11px 22px;
    background: linear-gradient(135deg, rgba(30, 30, 35, 0.8), rgba(40, 40, 45, 0.8));
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    border: 1px solid rgba(113, 113, 122, 0.3);
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.back-home-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 212, 216, 0.1), transparent);
    transition: left 0.6s ease;
}

.back-home-button:hover::before {
    left: 100%;
}

.back-home-button:hover {
    background: linear-gradient(135deg, rgba(63, 63, 70, 0.8), rgba(82, 82, 91, 0.8));
    border-color: rgba(161, 161, 170, 0.5);
    transform: translateX(5px);
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    margin-top: 6px;
    padding: 0;
    flex: 1;
    min-height: calc(100vh - 150px);
    position: relative;
    z-index: 10;
    width: 100vw;
    justify-content: center;
}

.container {
    display: flex;
    flex-direction: column;
    width: 100vw;
    max-width: none;
    margin: 0;
    padding: 4px 24px 8px 24px;
    animation: fadeInUp 1s ease-out;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    flex: 1;
}

/* World Map Container - Palantir Style */
#world-map-container {
    position: relative;
    width: 80%;
    height: 80vh;
    max-height: calc(100vh - 250px);
    background: #0b0f19;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    margin: auto;
}

#world-map,
#grid-overlay {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

#world-map {
    z-index: 2;
}

#grid-overlay {
    z-index: 1;
    pointer-events: none;
    opacity: 0.15;
}

/* Continent paths */
.continent {
    fill: #1e2635;
    stroke: rgba(30, 38, 53, 0.8);
    stroke-width: 0.5;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.continent:hover,
.continent.hovered {
    fill: #2a3544;
    stroke: #00ffff;
    stroke-width: 2;
    filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.6));
}

/* Grid lines - 6-8% opacity */
.grid-line {
    stroke: rgba(0, 255, 255, 0.07);
    stroke-width: 0.5;
}

/* Tooltip */
#map-tooltip {
    position: absolute;
    background: rgba(11, 15, 25, 0.95);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #00ffff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 8px rgba(0, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

#map-tooltip.visible {
    opacity: 1;
}

/* Map Controls */
#map-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.map-btn {
    background: rgba(11, 15, 25, 0.95);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #00ffff;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.map-btn:hover {
    background: rgba(11, 15, 25, 1);
    border-color: rgba(0, 255, 255, 0.6);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 8px rgba(0, 255, 255, 0.3);
}

/* Site Panel */
.site-panel {
    position: absolute;
    top: 0;
    right: -500px;
    width: 450px;
    height: 100%;
    background: rgba(11, 15, 25, 0.98);
    border-left: 1px solid rgba(0, 255, 255, 0.3);
    padding: 30px 20px;
    z-index: 200;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    overflow-y: hidden;
}

.site-panel.visible {
    right: 0;
}

.panel-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #00ffff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.panel-close:hover {
    opacity: 0.7;
}

.site-panel h3 {
    color: #00ffff;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px 0;
    padding-right: 40px;
}

.panel-header-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.panel-chip {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 4px;
    font-size: 12px;
    color: #00ffff;
    font-weight: 500;
}

.panel-status.status-operating {
    background: rgba(0, 255, 255, 0.15);
    border-color: rgba(0, 255, 255, 0.5);
}

.panel-status.status-development {
    background: rgba(0, 200, 200, 0.15);
    border-color: rgba(0, 200, 200, 0.5);
    color: #00c8c8;
}

.panel-status.status-prospect {
    background: rgba(100, 100, 120, 0.15);
    border-color: rgba(100, 100, 120, 0.5);
    color: #9ca3af;
}

.panel-status.status-hq {
    background: rgba(150, 150, 150, 0.15);
    border-color: rgba(150, 150, 150, 0.5);
    color: #9ca3af;
}

.panel-section {
    margin-bottom: 20px;
    color: #e5e7eb;
    font-size: 14px;
    line-height: 1.6;
}

.panel-field {
    display: flex;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.panel-field-label {
    font-weight: 600;
    color: #00ffff;
    min-width: 100px;
    margin-right: 8px;
}

.panel-field span:not(.panel-field-label) {
    color: #e5e7eb;
}

.panel-notes-short {
    color: #e5e7eb;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.panel-expand-btn {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #00ffff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.panel-expand-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: rgba(0, 255, 255, 0.5);
}

.panel-notes-long {
    color: #e5e7eb;
    font-size: 14px;
    line-height: 1.5;
    margin-top: 8px;
}

.panel-image-container {
    margin-top: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
}

.panel-image {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    margin-bottom: 15px;
}

#panel-video {
    display: none;
    margin-bottom: 15px;
}

.panel-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.panel-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid;
}

.panel-btn-primary {
    background: rgba(0, 255, 255, 0.1);
    border-color: rgba(0, 255, 255, 0.4);
    color: #00ffff;
}

.panel-btn-primary:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: rgba(0, 255, 255, 0.6);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
}

.panel-btn-secondary {
    background: rgba(15, 20, 30, 0.8);
    border-color: rgba(0, 255, 255, 0.3);
    color: #00ffff;
}

.panel-btn-secondary:hover {
    background: rgba(15, 20, 30, 1);
    border-color: rgba(0, 255, 255, 0.5);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.2);
}

/* UAMY Markers - Shape-based */
.uamy-marker {
    pointer-events: all;
    transition: transform 0.2s ease;
}

.marker-glow {
    animation: pulse-glow 3s ease-in-out infinite;
    filter: drop-shadow(0 0 4px rgba(0, 255, 255, 0.6));
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 0.85;
    }
    50% {
        opacity: 0.95;
    }
}

.marker-core {
    filter: drop-shadow(0 0 2px rgba(0, 255, 255, 0.8));
    transition: all 0.2s ease;
}

.marker-dot {
    filter: drop-shadow(0 0 3px rgba(0, 255, 255, 0.9));
}

.marker-hitbox {
    cursor: pointer;
}

@media (max-width: 768px) {
    .marker-hitbox {
        r: 12 !important; /* 24px diameter for mobile */
    }
}

.markers-group {
    pointer-events: all;
    z-index: 10;
    opacity: 1 !important;
}

/* Marker Cluster */
.marker-cluster {
    pointer-events: all;
    cursor: pointer;
}

.cluster-indicator {
    transition: all 0.2s ease;
    fill: rgba(11, 15, 25, 0.9);
    stroke: #00ffff;
    stroke-width: 1;
}

.marker-cluster:hover .cluster-indicator {
    r: 14;
    opacity: 0.9;
}

/* Spiderfy */
.spiderfy-group {
    pointer-events: all;
    z-index: 11;
}

.spiderfy-line {
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.spiderfied {
    transition: transform 0.2s ease;
}

/* Static Labels */
.marker-label-static {
    pointer-events: none;
    text-shadow: 0 0 6px rgba(0, 255, 255, 0.8), 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Map Legend */
.map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(11, 15, 25, 0.9);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #00ffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-item svg {
    flex-shrink: 0;
}

/* Marker Tooltip */
.marker-tooltip {
    position: fixed;
    background: rgba(15, 20, 30, 0.95);
    border: 1px solid rgba(0, 255, 255, 0.4);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 6px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1000;
    max-width: 300px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 12px rgba(0, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.marker-tooltip.visible {
    opacity: 1;
}

.tooltip-name {
    font-weight: 700;
    font-size: 14px;
    color: #ffffff;
    margin-bottom: 4px;
}

.tooltip-type {
    font-weight: 600;
    font-size: 12px;
    color: #00ffff;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tooltip-notes {
    font-size: 12px;
    color: #e5e7eb;
    line-height: 1.2;
}

/* Cluster Tooltip */
.cluster-sites {
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.cluster-site {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: #e5e7eb;
    cursor: pointer;
    transition: color 0.2s ease;
}

.cluster-site:hover {
    color: #00ffff;
}

.cluster-icon {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #00ffff;
    border-radius: 2px;
}

.cluster-icon.marker-hq {
    border-radius: 50%;
    border: 1px solid #00ffff;
    background: transparent;
}

.cluster-icon.marker-mine {
    transform: rotate(45deg);
    border-radius: 0;
}

.cluster-icon.marker-prospect {
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    border-radius: 0;
}

.cluster-icon.marker-processing {
    clip-path: polygon(30% 0%, 70% 0%, 100% 50%, 70% 100%, 30% 100%, 0% 50%);
    border-radius: 0;
}

@media (max-width: 768px) {
    #world-map-container {
        width: 95%;
        height: 70vh;
    }
    
    .site-panel {
        width: 100%;
        right: -100%;
    }
    
    #map-controls {
        bottom: 10px;
        right: 10px;
    }
    
    .map-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page Title */
.page-title {
    font-size: 24px;
    font-weight: 500;
    color: #cfcfcf;
    letter-spacing: 0px;
    margin: 0;
    text-align: center;
    opacity: 0.7;
    flex: 1;
}

@media (max-width: 480px) {
    .page-title {
        font-size: 16px;
        margin: 0;
    }
}

/* Cards Grid - 4 columns with wider cards and more spacing */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 450px));
    gap: 12px 20px;
    width: 100%;
    max-width: none;
    padding: 0;
    justify-content: center;
}

/* Compact Company Card */
.company-card {
    background: #111315;
    border: 1px solid #1F2428;
    border-radius: 8px;
    padding: 7px 13px;
    min-height: 200px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.company-card:hover {
    background: #0B0C0F;
    border-color: #2a2e34;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    z-index: 100;
}

/* Subtle glow and tinted background based on relationship */
.company-card.confirmed {
    border-color: rgba(34, 197, 94, 0.3);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.03) 0%, rgba(17, 19, 21, 0.97) 100%);
}

.company-card.confirmed:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05) 0%, rgba(11, 12, 15, 0.97) 100%);
}

.company-card.potential {
    border-color: rgba(34, 211, 238, 0.3);
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.03) 0%, rgba(17, 19, 21, 0.97) 100%);
}

.company-card.potential:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(34, 211, 238, 0.2);
    border-color: rgba(34, 211, 238, 0.5);
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.05) 0%, rgba(11, 12, 15, 0.97) 100%);
}

.company-card.target {
    border-color: rgba(251, 191, 36, 0.3);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.03) 0%, rgba(17, 19, 21, 0.97) 100%);
}

.company-card.target:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.5);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.05) 0%, rgba(11, 12, 15, 0.97) 100%);
}

.company-card.competitor {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.03) 0%, rgba(17, 19, 21, 0.97) 100%);
}

.company-card.competitor:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(11, 12, 15, 0.97) 100%);
}

.company-card.past {
    border-color: rgba(156, 163, 175, 0.3);
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.03) 0%, rgba(17, 19, 21, 0.97) 100%);
}

.company-card.past:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(156, 163, 175, 0.2);
    border-color: rgba(156, 163, 175, 0.5);
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.05) 0%, rgba(11, 12, 15, 0.97) 100%);
}

/* Compact Header - Ticker · Country on left, Market Cap on right */
.card-header-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 600;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.card-header-compact .ticker {
    color: #22C55E; /* emerald-500 - bright green */
    font-weight: 700;
    letter-spacing: 0.3px;
}

.card-header-compact .separator {
    color: #4B5563; /* neutral-600 */
    font-weight: 400;
}

.card-header-compact .country-iso {
    background: rgba(60, 60, 70, 0.5);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #9CA3AF; /* neutral-400 */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-header-compact .flag-img {
    width: 16px;
    height: 12px;
    vertical-align: middle;
    display: inline-block;
    margin-right: 2px;
    border-radius: 1px;
}

.card-header-compact .dod-badge-header {
    font-size: 11px;
    line-height: 1;
    vertical-align: middle;
    margin-left: 4px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.company-card:hover .dod-badge-header {
    opacity: 1;
}

/* Market Cap - Bright green, right-aligned */
.market-cap-display {
    font-size: 13px;
    font-weight: 600;
    color: #22C55E; /* emerald-400 - bright green */
    letter-spacing: 0.3px;
}

/* Card Content - Aligned vertical grid */
.card-content {
    font-size: 13px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Business Name Row - Name and Minerals side by side */
.business-name-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.business-name {
    font-size: 13px;
    font-weight: 600;
    color: #F9FAFB; /* neutral-50 - brightest white */
    line-height: 1.2;
    margin: 0;
}

.minerals-inline {
    font-size: 13px;
    font-weight: 500;
    color: #60A5FA; /* blue-400 - light blue */
    line-height: 1.2;
}

/* Project Location Section with borders */
.project-location-section {
    margin-top: 6px;
    margin-bottom: 6px;
    padding-top: 6px;
    padding-bottom: 6px;
    border-top: 1px solid #1F2428;
    border-bottom: 1px solid #1F2428;
}

/* Field Rows - Consistent spacing */
.field-row {
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 3px;
    color: #E5E7EB; /* neutral-200 body text */
}

.field-row .icon {
    font-size: 12px;
    margin-right: 4px;
    color: #22C55E; /* subtle emerald tint for icons */
    opacity: 0.8;
}

.field-row.minerals {
    color: #E5E7EB;
    font-weight: 500;
    margin-bottom: 4px;
}

/* Badges Row - Relationship and Offtake badges together */
.badges-row {
    margin-top: 6px;
    margin-bottom: 4px;
}

/* Minerals with badges on the same row */
.field-row.minerals-with-badges {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.minerals-text {
    color: #60A5FA; /* blue-400 - light blue */
    font-weight: 500;
    font-size: 10px;
    flex: 1 1 auto;
    min-width: 0;
}

/* Project and Location - Perfect alignment on vertical grid */
.field-row.project,
.field-row.location {
    display: flex;
    align-items: baseline;
    gap: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-left: 0;
}

.field-icon {
    font-size: 11px;
    flex-shrink: 0;
    color: #22C55E; /* emerald tinted icons */
    opacity: 0.7;
    width: 12px;
}

.field-label {
    font-size: 13px;
    font-weight: 500;
    color: #9CA3AF; /* neutral-400 for labels */
    flex-shrink: 0;
    min-width: 60px;
}

/* Notes Section - Faint separator line above, taller for more content */
.notes-section {
    font-size: 13px;
    line-height: 1.4;
    color: #9CA3AF; /* neutral-400 for notes text */
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #1F2428; /* faint separator matching card border */
    font-style: italic;
    max-height: 70px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.notes-section::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}


/* Compact Footer with badges and relationship */
.card-footer-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #1F2428; /* faint separator */
}

.badges {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.badge {
    font-size: 13px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    text-decoration: none;
    filter: brightness(0.9);
}

.badge:hover {
    opacity: 1;
    filter: brightness(1.1);
}

.badge.link {
    cursor: pointer;
    color: #22C55E; /* emerald accent for link */
}

/* Relationship Badges Container - supports multiple badges */
.relationship-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    flex-shrink: 0;
}

/* Relationship Badge - Pill style with brighter hues */
.relationship-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 9999px; /* fully rounded pill */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Offtake Badge Inline - matches relationship badges */
.offtake-badge-inline {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 9999px;
    background: rgba(59, 130, 246, 0.15); /* blue tint */
    color: #60A5FA; /* blue-400 */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.relationship-badge.confirmed {
    background: rgba(6, 78, 59, 0.4); /* bg-emerald-900/40 */
    color: #6EE7B7; /* text-emerald-300 */
}

.relationship-badge.potential {
    background: rgba(22, 78, 99, 0.4); /* bg-cyan-900/40 */
    color: #67E8F9; /* text-cyan-300 */
}

.relationship-badge.target {
    background: rgba(120, 53, 15, 0.4); /* bg-amber-900/40 */
    color: #FCD34D; /* text-amber-300 */
}

.relationship-badge.competitor {
    background: rgba(127, 29, 29, 0.4); /* bg-red-900/40 */
    color: #FCA5A5; /* text-red-300 */
}

.relationship-badge.past {
    background: rgba(55, 65, 81, 0.4); /* bg-gray-700/40 */
    color: #D1D5DB; /* text-gray-300 */
}

/* Loading States */
.loading-card {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(113, 113, 122, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.no-data-card,
.error-card {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: var(--text-secondary);
    background: rgba(20, 20, 25, 0.4);
    border-radius: 20px;
}

.error-card small {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.7;
}

/* Footer */
footer {
    background: linear-gradient(180deg, transparent, rgba(20, 20, 25, 0.8));
    backdrop-filter: blur(10px);
    padding: 1.5rem 1rem 1.5rem;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: auto;
    position: relative;
    z-index: 10;
}

.button-section {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
    justify-content: center;
    max-width: 800px;
}

.button-section a {
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    padding: 11px 22px;
    background: linear-gradient(135deg, rgba(30, 30, 35, 0.8), rgba(40, 40, 45, 0.8));
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    border: 1px solid rgba(113, 113, 122, 0.3);
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.button-section a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 212, 216, 0.1), transparent);
    transition: left 0.6s ease;
}

.button-section a:hover::before {
    left: 100%;
}

.button-section a:hover {
    background: linear-gradient(135deg, rgba(63, 63, 70, 0.8), rgba(82, 82, 91, 0.8));
    border-color: rgba(161, 161, 170, 0.5);
    transform: translateX(5px);
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Tablet - 3 columns */
@media (max-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
}

/* Mobile - 1 column */
@media (max-width: 768px) {
    .main-content {
        margin-top: 10px;
    }

    .container {
        padding: 6px 12px;
    }

    .page-title {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 12px;
        max-width: 100%;
    }

    .company-card {
        padding: 6px 8px;
        min-height: 160px;
    }

    .card-header-compact {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .header-left {
        gap: 4px;
    }

    .card-header-compact .country-iso {
        font-size: 10px;
        padding: 2px 5px;
    }

    .market-cap-display {
        font-size: 11px;
    }

    .business-name {
        font-size: 12px;
        margin-bottom: 5px;
    }

    .field-row {
        font-size: 10px;
        margin-bottom: 3px;
    }

    .field-icon {
        font-size: 10px;
        width: 10px;
    }

    .field-label {
        font-size: 9px;
        min-width: 45px;
    }

    .notes-section {
        font-size: 10px;
        margin-top: 5px;
        padding-top: 5px;
    }

    .card-footer-compact {
        margin-top: 5px;
        padding-top: 5px;
        gap: 5px;
    }

    .relationship-badge {
        font-size: 8px;
        padding: 2px 6px;
    }

    .badge {
        font-size: 12px;
    }

    .business-name-row {
        gap: 3px;
    }

    .business-name {
        font-size: 11px;
    }

    .minerals-inline {
        font-size: 11px;
    }

    .project-location-section {
        margin-top: 4px;
        margin-bottom: 4px;
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .field-row {
        font-size: 11px;
        margin-bottom: 2px;
    }

    .field-label {
        font-size: 11px;
        min-width: 55px;
    }

    .notes-section {
        font-size: 11px;
        max-height: 50px;
        margin-top: 4px;
        padding-top: 4px;
    }

    .badges-row {
        margin-top: 4px;
        margin-bottom: 3px;
    }

    .relationship-badge {
        font-size: 9px;
        padding: 2px 6px;
    }

    .offtake-badge-inline {
        font-size: 9px;
        padding: 2px 6px;
    }

    .dod-badge-header {
        font-size: 9px;
    }

    footer {
        padding: 0.5rem 0.75rem;
    }

    .button-section {
        gap: 8px;
    }

    .button-section a {
        padding: 8px 16px;
        font-size: 13px;
    }

    .back-home-button {
        position: relative;
        padding: 8px 16px;
        font-size: 13px;
        left: 0;
    }

    .title-row {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .page-title {
        width: 100%;
        text-align: left;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .container {
        padding: 4px 8px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .company-card {
        padding: 5px 7px;
        min-height: 140px;
    }

    .card-header-compact {
        font-size: 10px;
    }

    .card-header-compact .country-iso {
        font-size: 9px;
        padding: 1px 4px;
    }

    .market-cap-display {
        font-size: 10px;
    }

    .business-name {
        font-size: 10px;
    }

    .minerals-inline {
        font-size: 10px;
    }

    .field-row {
        font-size: 10px;
    }

    .field-label {
        font-size: 10px;
        min-width: 50px;
    }

    .notes-section {
        font-size: 10px;
        max-height: 45px;
    }

    .relationship-badge {
        font-size: 8px;
        padding: 2px 5px;
    }

    .offtake-badge-inline {
        font-size: 8px;
        padding: 2px 5px;
    }

    .dod-badge-header {
        font-size: 8px;
    }

    .back-home-button {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection colors */
::selection {
    background: rgba(113, 113, 122, 0.3);
    color: var(--primary-color);
}

::-moz-selection {
    background: rgba(113, 113, 122, 0.3);
    color: var(--primary-color);
}

