/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #c0c0c0; /* Silver */
    --primary-hover: #d8d8d8; /* Light silver */
    --accent-color: #a0a0a0; /* Darker silver */
    --bg-color: #0d0d0d;
    --card-bg: #1a1a1a;
    --modal-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --text-muted: #aaa;
    --border-radius: 8px;
    --glow-color: rgba(192, 192, 192, 0.6); /* Silver glow */
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden; /* Ensure no horizontal scroll */
    margin: 0; /* Ensure no default margins causing overflow */
    padding: 0;
}

/* Background pattern */
.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, rgba(16, 16, 20, 0.97), rgba(25, 25, 30, 0.95)),
        url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23303030' fill-opacity='0.2'%3E%3Cpath d='M50 50c0-5.523 4.477-10 10-10s10 4.477 10 10-4.477 10-10 10c0 5.523-4.477 10-10 10s-10-4.477-10-10 4.477-10 10-10zM10 10c0-5.523 4.477-10 10-10s10 4.477 10 10-4.477 10-10 10c0 5.523-4.477 10-10 10S0 25.523 0 20s4.477-10 10-10zm10 8c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zm40 40c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8z' /%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: -1;
    pointer-events: none;
}

/* Header */
header {
    background-color: rgba(20, 20, 22, 0.85);
    backdrop-filter: blur(10px);
    color: white;
    padding: 2rem 0;
    text-align: center;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 2.8rem;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
    background: linear-gradient(90deg, #ffffff, #c0c0c0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
}

header h1::before {
    content: "SKAR'S";
    position: absolute;
    top: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    letter-spacing: 5px;
    color: #a0a0a0;
    font-weight: 500;
    opacity: 0.8;
}


nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem 1.2rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: 500;
}

nav a:hover, nav a.active {
    color: white;
    background-color: rgba(192, 192, 192, 0.2);
    box-shadow: 0 0 10px rgba(192, 192, 192, 0.3);
}

/* Map Gallery */
.map-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1500px;
    margin: 0 auto;
}

/* Map Card */
.map-card {
    position: relative;
    transition: transform 0.3s ease;
    border-radius: var(--border-radius);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.map-card:hover {
    transform: translateY(-5px);
}

.map-thumbnail {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.map-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
}

.map-card:hover .map-thumbnail img {
    transform: scale(1.05);
    filter: none;
}

/* Glow effect */
.glow-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--border-radius);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

.map-card:hover .glow-effect {
    opacity: 1;
    box-shadow: 
        inset 0 0 0 1px var(--primary-color),
        0 0 20px var(--glow-color);
}

/* Map title */
.map-title-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 20%, transparent 100%);
    padding: 2rem 1.2rem 1.2rem;
    z-index: 1;
}

.map-title {
    font-family: 'Rajdhani', sans-serif;
    color: white;
    font-size: 1.6rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    transform: translateY(0);
    transition: transform 0.3s ease;
    position: relative;
}

.map-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.map-card:hover .map-title {
    transform: translateY(-5px);
}

.map-card:hover .map-title::after {
    width: 80px;
}

/* Modal */
.map-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.map-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--modal-bg);
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1002;
}

.map-modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #333;
}

.modal-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
}

/* Fix modal body to prevent vertical scrollbar */
.modal-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 180px); /* Adjust based on header/footer height */
}

/* Make description more compact */
.modal-description {
    font-size: 1rem; /* Smaller font */
    line-height: 1.5; /* Tighter line height */
    margin-bottom: 1.25rem; /* Reduced margin */
    color: var(--text-color);
}

.modal-gallery {
    margin-bottom: 1.5rem;
}

/* Reduce gallery height slightly */
.gallery-main {
    width: 100%;
    margin-bottom: 0.5rem; /* Reduced margin */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    background-color: #111;
    position: relative;
    aspect-ratio: 16 / 9;
    max-height: 600px; /* Limit maximum height */
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

.gallery-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #333;
}

.gallery-thumbs::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 10px;
}

.gallery-thumbs::-webkit-scrollbar-track {
    background: #333;
    border-radius: 10px;
}

.gallery-thumbs::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 10px;
}

.thumb {
    width: 100px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    flex-shrink: 0;
    border: 2px solid transparent;
    position: relative;
}

.thumb:hover {
    opacity: 0.9;
}

.thumb.active {
    opacity: 1;
    border-color: var(--primary-color);
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.modal-credits {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 1.25rem;
    border-radius: 8px;
}

.modal-credits h3 {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
    color: var(--primary-color);
}

.modal-credits p {
    font-size: 0.9rem;
    line-height: 1.5;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #333;
    display: flex;
    justify-content: flex-end;
}

.download-button {
    background-color: var(--primary-color);
    color: #333; /* Darker text for better contrast on silver */
    text-decoration: none;
    padding: 0.8rem 1.8rem;
    border-radius: 4px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.download-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(192, 192, 192, 0.3);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.close-modal:hover {
    background-color: rgba(255, 0, 0, 0.7);
    transform: rotate(90deg);
}

/* Fullscreen button */
.fullscreen-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: background-color 0.3s;
    opacity: 0;
}

.gallery-main:hover .fullscreen-btn {
    opacity: 1;
}

.fullscreen-btn:hover {
    background-color: var(--primary-color);
}

/* Fullscreen view */
.fullscreen-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fullscreen-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
}

.fullscreen-content img {
    max-width: 100%;
    max-height: 95vh;
    object-fit: contain;
    display: block;
}

.close-fullscreen {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.close-fullscreen:hover {
    color: var(--primary-color);
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .map-gallery {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-title {
        font-size: 1.8rem;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 480px) {
    nav ul {
        gap: 0.5rem;
    }
    
    nav a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .modal-header, .modal-footer {
        padding: 1rem 1.5rem;
    }
    
    .map-title {
        font-size: 1.3rem;
    }
}