/* Basic reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f0f2f5;
    padding: 0;
}

/* Navigation Bar Styles */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-logo a {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.navbar-links {
    display: flex;
    gap: 20px;
}

.navbar-links a {
    text-decoration: none;
    color: #333;
    font-size: 16px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.navbar-links a:hover {
    background-color: #f0f2f5;
}

.navbar-links a.active {
    background-color: #3498db;
    color: white;
}

/* Game Styles */
#game {
    max-width: 800px;
    margin: 20px auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
}

h1 {
    text-align: center;
    margin-bottom: 15px;
    color: #333;
    font-size: 24px;
}

#map-container {
    width: 100%;
    height: 400px; /* Keep the image size the same */
    background-color: #eee;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    overflow: hidden;
}

#trail-map {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#guess-form {
    display: flex;
    margin-bottom: 10px;
    gap: 8px;
}

.search-container {
    position: relative;
    flex: 1;
}

#guess-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 180px;
    overflow-y: auto;
    z-index: 10;
    display: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #2980b9;
}

/* Resort details link - styled as button */
.resort-details-link {
    display: inline-block;
    background-color: #3498db;
    color: white !important;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
    margin: 10px 0;
    text-align: center;
}

.resort-details-link:hover {
    background-color: #2980b9;
    text-decoration: none;
}

#guesses {
    margin-top: 15px;
}

.guess-placeholder {
    background-color: #f0f2f5;
    border-radius: 4px;
    height: 45px; /* Smaller height for guesses */
    margin-bottom: 6px; /* Less margin between guesses */
}

.guess-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px; /* Less padding */
    margin-bottom: 6px; /* Less margin */
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 14px; /* Smaller font */
}

.guess-item.correct {
    background-color: #fffde7;
}

.resort-name {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.resort-name span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Flag emoji styling */
.flag-emoji {
    font-size: 1.2em;
    margin-right: 5px;
    display: inline-block;
}

.flag-placeholder {
    display: inline-block;
    min-width: 1.5em;
    height: 1em;
    background-color: #f0f0f0;
    text-align: center;
    font-size: 0.8em;
    line-height: 1em;
    margin-right: 5px;
    border: 1px solid #ddd;
    padding: 0 3px;
}

.external-link {
    color: #aaa;
    cursor: pointer;
    margin-left: 4px;
    font-size: 12px;
    flex-shrink: 0;
}

.guess-info {
    display: flex;
    gap: 12px; /* Less gap */
    align-items: center;
    flex-shrink: 0;
}

.distance {
    min-width: 70px; /* Smaller width */
    text-align: right;
}

.direction {
    width: 24px; /* Smaller */
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Style for SVG direction arrows */
.direction svg {
    display: block;
    color: #3498db;
    stroke-width: 2;
}

.similarity {
    display: flex;
    gap: 8px;
    align-items: center;
}

.similarity-grid {
    display: flex;
    gap: 1px; /* Less gap */
}

.grid-square {
    width: 6px; /* Smaller squares */
    height: 6px;
    background-color: #ddd;
    transition: background-color 0.5s, transform 0.3s;
}

.grid-square.filled {
    background-color: #4caf50;
    transform: scale(1.1);
}

.percentage {
    min-width: 40px; /* Smaller width */
    text-align: right;
}

#game-over {
    margin-top: 15px;
    padding: 12px;
    background-color: #e3f2fd;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
}

#game-over button {
    align-self: flex-start;
}

#attempts-left {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

/* Responsive design adjustments */
@media (max-width: 600px) {
    .guess-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .guess-info {
        width: 100%;
        justify-content: space-between;
    }
    
    .resort-name {
        width: 100%;
    }
    
    .navbar {
        flex-direction: column;
        gap: 10px;
    }
}

.flag-icon {
    width: 1.5em;
    height: 1em;
    margin-right: 5px;
    display: inline-block;
    border: 1px solid #ddd;
    background-color: #f8f8f8;
}

/* Make sure SVGs are visible in all browsers */
svg {
    overflow: visible;
}

/* How to Play Page Styles */
.container {
    max-width: 800px;
    margin: 20px auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.how-to-play-content {
    max-width: 700px;
    margin: 0 auto;
}

.how-to-play-content h1 {
    margin-bottom: 25px;
    text-align: center;
    font-size: 28px;
}

.intro-text {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
}

.section {
    margin-bottom: 25px;
}

.section p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.section ul {
    padding-left: 20px;
    margin-bottom: 20px;
}

.section li {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.example-container {
    margin: 30px 0;
    text-align: center;
}

.example-image {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.caption {
    font-size: 14px;
    color: #777;
    margin-top: 8px;
}

.indicator-examples {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 20px 0;
}

.indicator-example {
    text-align: center;
}

.direction-example, .distance-example {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.direction-example svg {
    width: 40px;
    height: 40px;
}

.distance-example span {
    font-size: 18px;
    font-weight: bold;
}

.similarity-grid-example {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.similarity-grid-example .similarity-grid {
    display: flex;
    gap: 3px;
}

.similarity-grid-example .grid-square {
    width: 15px;
    height: 15px;
    border-radius: 2px;
}

.similarity-grid-example .percentage {
    font-size: 18px;
    font-weight: bold;
}

.resort-details-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
}

.resort-loading {
    text-align: center;
    padding: 40px 0;
    font-size: 18px;
    color: #666;
}

.resort-error {
    text-align: center;
    padding: 40px 0;
    color: #d9534f;
}

.resort-content h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #333;
}

.resort-meta {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

.resort-images {
    margin: 20px 0;
    text-align: center;
}

.main-resort-image {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.resort-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin: 20px 0;
}

.stat-item {
    flex-basis: 48%;
    margin-bottom: 15px;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.stat-item h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
}

.stat-item p {
    margin: 0;
    font-size: 16px;
    color: #666;
}

.resort-description {
    margin: 30px 0;
}

.resort-description h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.resort-description p {
    font-size: 16px;
    line-height: 1.6;
    color: #444;
}

.back-to-game {
    margin-top: 30px;
    text-align: center;
}

.button  {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 16px;
    transition: background-color 0.2s;
}

.button:hover {
    background-color: #2980b9;
}

@media (max-width: 600px) {
    .stat-item {
        flex-basis: 100%;
    }
}


#game-over {
    /* Update your existing game-over style to add more space */
    margin-top: 15px;
    padding: 15px;
    background-color: #e3f2fd;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
}
/* Snowflake loader */
.loader-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 100;
  }
  
  .snowflake-loader {
    width: 80px;
    height: 80px;
    animation: spin 2s linear infinite;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* Hide the loader when content is loaded */
  .loaded .loader-container {
    display: none;
  }

  .already-played-message {
    text-align: center;
    padding: 40px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
  }
  
  .already-played-message h3 {
    color: #28a745;
    margin-bottom: 15px;
  }
  
  .already-played-message p {
    margin: 10px 0;
    color: #666;
  }

  /* Share Widget Styles */
.share-widget {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .share-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  
  .share-button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  }
  
  .share-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  
  .share-button svg {
    flex-shrink: 0;
  }
  
  /* Already played and previous results styles */
  .already-played-message {
    text-align: center;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 15px 0;
  }
  
  .already-played-message h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 20px;
  }
  
  .already-played-message p {
    color: #666;
    margin: 8px 0;
    font-size: 14px;
  }
  
  .already-played-message #countdown {
    font-weight: 600;
    color: #3498db;
  }
  
  .previous-results {
    text-align: center;
    padding: 15px;
    background-color: #e3f2fd;
    border-radius: 8px;
    margin: 15px 0;
  }
  
  .previous-results h4 {
    color: #333;
    margin-bottom: 8px;
    font-size: 16px;
  }
  
  .previous-results p {
    color: #555;
    font-size: 14px;
  }

  
  /* Responsive adjustments for share widget */
  @media (max-width: 600px) {
    .share-widget {
      flex-direction: column;
      align-items: stretch;
    }
    
    .share-button {
      justify-content: center;
      width: 100%;
    }
  }