/* World Map Specific Styles */

.world-map-main {
    padding: 2rem 0 3rem 0;
    position: relative;
}

.world-map-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 10% 20%, rgba(212, 175, 55, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(114, 47, 55, 0.01) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.hero-section {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding-bottom: 2rem;
}

.coat-of-arms-container {
    margin-bottom: 2rem;
    position: relative;
}

.coat-of-arms {
    max-width: 180px;
    height: auto;
    filter: drop-shadow(0 8px 24px rgba(114, 47, 55, 0.2));
    transition: transform 0.3s ease;
}

.coat-of-arms:hover {
    transform: scale(1.02);
}

.world-map-motto {
    margin: 2rem 0 0 0 !important;
}

.map-description {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: var(--warm-gray);
    font-style: italic;
    margin: 0;
    letter-spacing: 0.01em;
    line-height: 1.7;
}

/* Map Section */
.map-section {
    max-width: 1400px;
    width: 100%;
    margin: 3rem auto 0;
    padding: 0 1rem;
    position: relative;
}

/* Map Controls */
.map-controls {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(15px);
    border-radius: 50px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: 
        0 8px 32px rgba(114, 47, 55, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 10;
}

.control-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.6));
    color: var(--primary-burgundy);
    border: 2px solid rgba(212, 175, 55, 0.3);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 
        0 6px 20px rgba(114, 47, 55, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
    transition: left 0.4s ease;
}

.control-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.8));
    border-color: var(--rich-gold);
    color: var(--deep-burgundy);
    transform: scale(1.05);
    box-shadow: 
        0 10px 30px rgba(114, 47, 55, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.control-btn:hover::before {
    left: 100%;
}

.control-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.zoom-level {
    font-family: var(--font-display);
    color: var(--primary-burgundy);
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0 1rem;
    letter-spacing: 0.05em;
    min-width: 60px;
    text-align: center;
}

/* Map Frame */
.map-frame {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(250, 247, 240, 0.9));
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 2.5rem;
    box-shadow: 
        0 40px 120px rgba(114, 47, 55, 0.15),
        0 20px 60px rgba(114, 47, 55, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(212, 175, 55, 0.2);
    position: relative;
    overflow: hidden;
}

.map-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--rich-gold) 20%, 
        var(--antique-gold) 50%, 
        var(--rich-gold) 80%, 
        transparent
    );
}

.map-frame::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.map-frame-border {
    position: relative;
    border: 3px double rgba(212, 175, 55, 0.4);
    border-radius: 15px;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(248, 245, 240, 0.5));
    backdrop-filter: blur(10px);
}

.frame-ornament {
    position: absolute;
    color: var(--rich-gold);
    font-size: 1.5rem;
    text-shadow: 0 2px 6px rgba(212, 175, 55, 0.3);
}

.frame-ornament.top-left {
    top: -15px;
    left: -15px;
}

.frame-ornament.top-right {
    top: -15px;
    right: -15px;
}

.frame-ornament.bottom-left {
    bottom: -15px;
    left: -15px;
}

.frame-ornament.bottom-right {
    bottom: -15px;
    right: -15px;
}

/* Map Container */
.map-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #f5f5f0, #fffbf7);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.05);
}

.world-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.world-svg path {
    fill: #e8e3d8;
    stroke: #d4af37;
    stroke-width: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.world-svg path:hover {
    fill: #d4c5a9;
    stroke: #ffd700;
    stroke-width: 1px;
    filter: drop-shadow(0 4px 8px rgba(212, 175, 55, 0.3));
}

.world-svg path.visited {
    fill: #D4AF37;
    stroke: #B8860B;
    stroke-width: 1.5px;
    transition: all 0.3s ease;
}

.world-svg path.visited:hover {
    fill: #FFD700;
    stroke: #D4AF37;
    stroke-width: 2px;
    filter: drop-shadow(0 4px 12px rgba(212, 175, 55, 0.5));
}

.world-svg path.unvisited {
    fill: #D4D0C4;
    stroke: #A39E91;
    stroke-width: 0.5px;
    transition: all 0.3s ease;
}

.world-svg path.unvisited:hover {
    fill: #B8B0A0;
    stroke: #D4AF37;
    stroke-width: 1px;
    filter: drop-shadow(0 2px 8px rgba(114, 47, 55, 0.2));
}

.country-tooltip {
    position: fixed;
    background: rgba(114, 47, 55, 0.95);
    color: #faf7f0;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-display);
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(114, 47, 55, 0.3);
    letter-spacing: 0.05em;
    border: 1px solid rgba(212, 175, 55, 0.4);
    white-space: nowrap;
}

#scratchCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    z-index: 2;
    display: none;
}

/* Map Statistics */
.map-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    padding: 2.5rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.4));
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 
        0 25px 80px rgba(114, 47, 55, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.2);
    position: relative;
}

.map-stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--rich-gold), var(--antique-gold), var(--rich-gold), transparent);
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.2));
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.4));
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(114, 47, 55, 0.1);
}

.stat-label {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--warm-gray);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-burgundy);
    text-shadow: 0 2px 4px rgba(114, 47, 55, 0.1);
    letter-spacing: 0.02em;
}

/* Legend Section */
.legend-section {
    max-width: 1400px;
    margin: 3rem auto 0;
    padding: 2.5rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.4));
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 
        0 25px 80px rgba(114, 47, 55, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.2);
    position: relative;
    overflow: hidden;
}

.legend-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--rich-gold), var(--antique-gold), var(--rich-gold), transparent);
}

.legend-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-burgundy);
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 4px rgba(114, 47, 55, 0.1);
}

.legend-items {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    transition: all 0.3s ease;
}

.legend-item:hover {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
}

.legend-color {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    transition: all 0.3s ease;
}

.legend-color.visited {
    background: #D4AF37;
    border: 2px solid #B8860B;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.legend-color.unvisited {
    background: #D4D0C4;
    border: 2px solid #A39E91;
}

.legend-color.hover-state {
    background: #B8B0A0;
    border: 2px solid #D4AF37;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

.legend-item span {
    font-family: var(--font-display);
    color: var(--charcoal);
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .map-frame {
        padding: 2rem;
    }
    
    .map-stats {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 1.5rem;
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .coat-of-arms {
        max-width: 140px;
    }
    
    .map-frame {
        padding: 1.5rem;
    }
    
    .map-frame-border {
        padding: 1rem;
    }
    
    .map-container {
        aspect-ratio: 16 / 12;
    }
    
    .map-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
    
    .zoom-level {
        width: 100%;
        margin: 0.5rem 0 0 0;
    }
    
    .map-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .stat-item {
        padding: 1.25rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .legend-items {
        flex-direction: column;
        gap: 1rem;
    }
    
    .legend-item {
        justify-content: flex-start;
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .coat-of-arms {
        max-width: 110px;
    }
    
    .map-frame {
        padding: 1rem;
        border-radius: 15px;
        margin: 0 -1rem;
    }
    
    .map-frame-border {
        padding: 0.75rem;
        border-radius: 10px;
    }
    
    .frame-ornament {
        font-size: 1.2rem;
        top: -10px;
        right: -10px;
        bottom: -10px;
        left: -10px;
    }
    
    .map-container {
        aspect-ratio: 16 / 14;
    }
    
    .map-controls {
        padding: 0.75rem;
        gap: 0.4rem;
    }
    
    .control-btn {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    .zoom-level {
        font-size: 0.85rem;
    }
    
    .map-stats {
        padding: 1rem;
    }
    
    .stat-item {
        padding: 1rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .stat-value {
        font-size: 1.6rem;
    }
    
    .legend-section {
        padding: 1.5rem;
        margin: 2rem -1rem 0;
    }
    
    .legend-title {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
    
    .legend-items {
        gap: 0.75rem;
    }
    
    .legend-item {
        padding: 0.5rem;
        gap: 0.75rem;
    }
    
    .legend-color {
        width: 24px;
        height: 24px;
    }
    
    .legend-item span {
        font-size: 0.9rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-section > * {
    animation: fadeInUp 0.8s ease-out forwards;
}

.coat-of-arms-container {
    animation-delay: 0.2s;
}

.title-section {
    animation-delay: 0.3s;
}

.world-map-motto {
    animation-delay: 0.4s;
}

.map-section {
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.map-stats {
    animation: fadeInUp 0.8s ease-out 0.7s both;
}

.legend-section {
    animation: fadeInUp 0.8s ease-out 0.9s both;
}

/* Visited Flags Section */
.visited-flags-section {
    padding: 2rem 1rem;
    margin-top: 1rem;
    border-top: 2px solid rgba(114, 47, 55, 0.3);
    animation: fadeInUp 0.8s ease-out 1.1s both;
}

.visited-flags-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-burgundy);
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

.visited-flags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: flex-start;
    align-items: flex-start;
}

.flag-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.flag-item:hover {
    transform: scale(1.1) translateY(-3px);
    filter: drop-shadow(0 4px 12px rgba(212, 175, 55, 0.4));
}

.flag-icon {
    width: 48px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    border: 2px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 2px 8px rgba(114, 47, 55, 0.2);
    transition: border-color 0.3s ease;
}

.flag-item:hover .flag-icon {
    border-color: var(--color-gold);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.flag-label {
    font-family: var(--font-text);
    font-size: 0.75rem;
    color: var(--color-burgundy);
    text-align: center;
    line-height: 1.2;
    max-width: 60px;
    word-wrap: break-word;
}

/* Responsive */
@media (max-width: 768px) {
    .visited-flags-section {
        padding: 1.5rem 0.75rem;
    }

    .visited-flags-container {
        gap: 0.75rem;
    }

    .flag-icon {
        width: 40px;
        height: 30px;
    }

    .flag-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .visited-flags-container {
        gap: 0.5rem;
    }

    .flag-icon {
        width: 36px;
        height: 27px;
    }

    .flag-label {
        font-size: 0.65rem;
        max-width: 50px;
    }
}
