/* ===========================
   Global Impact Page Styles
   =========================== */

/* Map Section */
.map-section {
    padding: 2rem 0 4rem;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), transparent);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Main Content Layout */
.main-content {
    display: flex;
    gap: 2rem;
    position: relative;
}

/* Map Wrapper */
.map-wrapper {
    flex: 1;
    position: relative;
    height: 600px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.5);
}

#world-map {
    width: 100%;
    height: 100%;
}

.map-overlay-info {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.map-overlay-info p {
    color: var(--gray-300);
    font-size: 0.875rem;
    margin: 0;
}

/* Map Legend */
.map-legend {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    z-index: 10;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

.has-women-example {
    background: rgba(212, 175, 55, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.6);
    box-shadow: 0 0 4px rgba(212, 175, 55, 0.8);
}

.glow-hint {
    color: #D4AF37 !important;
    font-weight: bold;
    margin-top: 0.25rem !important;
    text-shadow: 0 0 4px rgba(212, 175, 55, 0.5);
    animation: text-glow 2s ease-in-out infinite alternate;
}

@keyframes text-glow {
    from {
        text-shadow: 0 0 4px rgba(212, 175, 55, 0.5);
    }
    to {
        text-shadow: 0 0 8px rgba(212, 175, 55, 0.8);
    }
}

/* Side Panel Toggle Button */
.side-panel-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--gold-300);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    z-index: 10;
}

.side-panel-toggle:hover {
    background: rgba(212, 175, 55, 0.3);
    color: var(--gold-100);
    transform: scale(1.1);
}

/* Side Panel */
.side-panel {
    width: 350px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 5;
}

.panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-family: var(--font-display);
    color: var(--gold-100);
    margin: 0;
    font-size: 1.5rem;
}

.close-panel {
    background: transparent;
    border: none;
    color: var(--gold-400);
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-base);
}

.close-panel:hover {
    background: rgba(212, 175, 55, 0.2);
    color: var(--gold-100);
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.panel-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold-300);
}

.panel-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.panel-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all var(--transition-base);
    cursor: pointer;
}

.panel-item:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
}

.panel-item-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--gold-500);
}

.panel-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.panel-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.panel-item-name {
    font-weight: 700;
    color: var(--gold-100);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.panel-item-type {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    display: inline-block;
    width: fit-content;
    margin-bottom: 0.25rem;
}

.panel-item-type.historical {
    background: rgba(64, 158, 255, 0.2);
    color: #409eff;
}

.panel-item-type.living {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.panel-item-type.nobel {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.panel-item-country {
    font-size: 0.8rem;
    color: var(--gray-400);
}

/* jsVectorMap Customization */
.jvm-tooltip {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--gold-500);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--gold-100);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Glowing dots for countries with women */
.jvm-region.has-women {
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.9)) drop-shadow(0 0 15px rgba(212, 175, 55, 0.6));
    animation: glow-pulse 2s ease-in-out infinite alternate;
    /* Add a subtle background to make it more visible */
    fill: rgba(212, 175, 55, 0.15) !important;
    stroke: rgba(212, 175, 55, 0.3) !important;
    stroke-width: 1px !important;
}

.jvm-region.has-women:hover {
    filter: drop-shadow(0 0 12px rgba(212, 175, 55, 1)) drop-shadow(0 0 20px rgba(212, 175, 55, 0.9)) !important;
    fill: rgba(212, 175, 55, 0.25) !important;
}

@keyframes glow-pulse {
    from {
        filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.9)) drop-shadow(0 0 15px rgba(212, 175, 55, 0.6));
    }
    to {
        filter: drop-shadow(0 0 12px rgba(212, 175, 55, 1)) drop-shadow(0 0 20px rgba(212, 175, 55, 0.8));
    }
}

/* Subscription Banner */
.legacy-banner {
    background: #554211;
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    margin: 4rem 0;
    text-align: center;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.banner-content h2.banner-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.banner-content p.banner-subtitle {
    font-size: 1.125rem;
    color: rgb(249, 241, 216);
    max-width: 700px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.banner-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.banner-email {
    width: 100%;
    max-width: 300px;
    padding: 1rem;
    border-radius: 0;
    border: 2px solid rgba(212, 175, 55, 0.3);
    background: rgba(26, 26, 26, 0.8);
    color: var(--gold-100);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: all var(--transition-base);
    box-sizing: border-box;
}

.banner-email:focus {
    outline: none;
    border-color: var(--gold-500);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.banner-btn.preorder-btn {
    background: var(--gold-gradient);
    color: var(--neutral-900);
    border: none;
    padding: 1rem;
    border-radius: 0;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 300px;
    box-sizing: border-box;
}

.banner-btn.preorder-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-slow);
    z-index: 1000;
    /* Make modal sticky */
    pointer-events: none;
}

.modal-overlay[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-panel {
    position: relative;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    background: linear-gradient(to bottom right, var(--neutral-800), var(--neutral-900));
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(212, 175, 55, 0.3);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform var(--transition-slow);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-overlay[aria-hidden="false"] .modal-panel {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 20;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--neutral-300);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.modal-close:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold-400);
    border-color: rgba(212, 175, 55, 0.3);
}

.modal-content {
    height: calc(90vh - 2rem);
    overflow-y: auto;
    padding: 4rem 2rem 2rem;
}

/* Modal Header */
.modal-header {
    position: relative;
    text-align: center;
    margin-bottom: 3rem;
}

.modal-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    opacity: 0.1;
    z-index: 1;
}

.modal-pattern-left,
.modal-pattern-right {
    position: absolute;
    top: 0;
    width: 100px;
    height: 100px;
    color: var(--gold-500);
}

.modal-pattern-left {
    left: 2rem;
}

.modal-pattern-right {
    right: 2rem;
    transform: rotate(180deg);
}

.modal-pattern svg {
    width: 100%;
    height: 100%;
}

.modal-image-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 2rem;
    z-index: 2;
}

.modal-image-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: var(--gold-gradient);
    filter: blur(20px);
    opacity: 0.5;
    z-index: -1;
}

.modal-image-border {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--gold-gradient);
    padding: 4px;
    overflow: hidden;
}

/* Category-specific modal border glows */
.modal-image-border.PART-I {
    background: linear-gradient(to bottom right, #409EFF, #2a7de1, #1a6dcc);
    box-shadow: 0 0 40px rgba(64, 158, 255, 0.6);
}

.modal-image-border.PART-II {
    background: linear-gradient(to bottom right, #9632dc, #7a28b8, #5e1e94);
    box-shadow: 0 0 40px rgba(150, 50, 220, 0.6);
}

.modal-image-border.PART-III {
    background: linear-gradient(to bottom right, #dc3232, #b82828, #941e1e);
    box-shadow: 0 0 40px rgba(220, 50, 50, 0.6);
}

.modal-image-border.PART-IV {
    background: linear-gradient(to bottom right, #ffc107, #e0a800, #c69500);
    box-shadow: 0 0 40px rgba(255, 193, 7, 0.6);
}

.modal-image-border.PART-V {
    background: linear-gradient(to bottom right, #28a745, #218838, #1e7e34);
    box-shadow: 0 0 40px rgba(40, 167, 69, 0.6);
}

.modal-image-border.PART-VI {
    background: linear-gradient(to bottom right, #6432dc, #5028b8, #3c1e94);
    box-shadow: 0 0 40px rgba(100, 50, 220, 0.6);
}

.modal-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: var(--neutral-700);
}

.modal-name-container {
    position: relative;
    z-index: 2;
}

.modal-divider-top,
.modal-divider-bottom {
    width: 100px;
    height: 2px;
    background: var(--gold-gradient);
    margin: 1rem auto;
    border-radius: var(--radius-full);
}

.modal-name {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold-100);
    margin-bottom: 0.5rem;
}

.modal-title {
    font-size: 1rem;
    color: var(--neutral-400);
}

/* Modal Body */
.modal-body {
    position: relative;
    z-index: 2;
}

.modal-quote-container {
    position: relative;
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(26, 26, 26, 0.5);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.modal-quote-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold-gradient);
}

.modal-quote {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.25rem;
    color: var(--neutral-200);
    line-height: 1.6;
    margin-bottom: 1rem;
    text-align: center;
}

.modal-quote-icon {
    position: absolute;
    top: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2rem;
    height: 2rem;
    color: var(--gold-500);
    background: var(--neutral-800);
    padding: 0.25rem;
    border-radius: var(--radius-full);
}

.modal-bio {
    margin-bottom: 2rem;
}

.chapter-intro {
    text-align: center;
    margin-bottom: 2rem;
}

.chapter-intro p {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--gold-400);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.bio-section {
    margin-bottom: 2rem;
}

.bio-section h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--gold-100);
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.bio-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--gold-gradient);
    border-radius: var(--radius-full);
}

.bio-section p {
    font-size: 1rem;
    color: var(--neutral-300);
    line-height: 1.7;
}

.modal-read-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto 3rem;
    padding: 0.75rem 1.5rem;
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold-300);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.modal-read-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    color: var(--gold-100);
    border-color: rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.modal-read-btn.speaking {
    background: var(--gold-gradient);
    color: var(--neutral-900);
    border-color: var(--gold-500);
}

.modal-read-btn svg {
    width: 1rem;
    height: 1rem;
}

/* Modal Footer */
.modal-footer {
    text-align: center;
    margin-top: 3rem;
}

.modal-footer-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.modal-footer-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold-500), transparent);
}

.modal-footer-line.right {
    background: linear-gradient(to left, transparent, var(--gold-500), transparent);
}

.modal-footer-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--gold-500);
    margin: 0 1rem;
}

.modal-footer-text {
    font-family: var(--font-display);
    font-size: 0.875rem;
    color: var(--gold-400);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Responsive */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }
    
    .side-panel {
        width: 100%;
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .map-wrapper {
        height: 400px;
    }
    
    .modal-image-container {
        height: 200px;
    }
    
    .modal-content {
        padding: 1rem;
    }
    
    .modal-name {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .panel-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .modal-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}