/* Modern Base Styles */
:root {
  --primary-color: #0f172a;
  --primary-light: #1e293b;
  --accent-color: #3b82f6;
  --accent-hover: #2563eb;
  --background-color: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --success-color: #10b981;
  --error-color: #ef4444;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--background-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 0;
  overflow-x: hidden;
}

/* Navigation */
.top-nav {
  background-color: var(--primary-color);
  padding: 1rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 1000;
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  font-size: 1.25rem;
  font-weight: 600;
}

.logo i {
  color: var(--accent-color);
}

/* Navigation Links */
.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  padding: 0.5rem 0;
  position: relative;
}

.nav-link:after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--accent-color);
  transition: width 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: white;
}

.nav-link:hover:after,
.nav-link.active:after {
  width: 100%;
}

/* Main Container */
.container {
  max-width: 1200px;
  width: 100%;
  margin: 1rem auto;
  padding: 0 2rem;
  flex: 1;
}

/* App Header */
.app-header {
  text-align: center;
  margin-bottom: 3rem;
  animation: slideInUp 0.8s ease-out;
}

.app-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Upload Box */
.upload-box {
  background: var(--card-bg);
  border: 2px dashed var(--border-color);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 3rem;
  transition: all 0.3s ease;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  animation: float 6s ease-in-out infinite;
}

.upload-box.dragover {
  border-color: var(--accent-color);
  background-color: rgba(59, 130, 246, 0.05);
  transform: scale(1.02);
  box-shadow: 0 12px 40px rgba(59, 130, 246, 0.15);
}

.upload-icon {
  font-size: 3rem;
  color: var(--accent-color);
  margin-bottom: 1.5rem;
}

.upload-box p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.upload-separator {
  color: var(--text-secondary);
  margin: 1rem 0;
}

.upload-button {
  background: var(--accent-color);
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.upload-button:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}

.upload-hint {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 1rem;
}

input[type="file"] {
  display: none;
}

/* Preview Section */
.preview-section {
  display: none;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  margin-top: 2rem;
}

.preview-section.active {
  display: flex;
}

.image-box {
  width: 100%;
  max-width: 900px;
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeScale 0.5s ease-out;
}

.image-box img {
  max-width: 100%;
  max-height: 600px;
  border-radius: 8px;
  object-fit: contain;
  transition: all 0.3s ease;
}

/* Metadata Box */
.metadata-box {
  width: 100%;
  max-width: 900px;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  animation: fadeScale 0.5s ease-out;
}

.metadata-box details {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.metadata-box details:first-child {
  margin-top: 0.5rem;
}

.metadata-box details:last-child {
  margin-bottom: 0.5rem;
}

.metadata-box details:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.metadata-box summary {
  padding: 1.25rem 1.5rem;
  background: var(--background-color);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.metadata-box summary:hover {
  background: rgba(59, 130, 246, 0.05);
  transform: translateX(4px);
}

.metadata-box summary i {
  color: var(--accent-color);
}

.metadata-box table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  table-layout: fixed;
}

.metadata-box th,
.metadata-box td {
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

.metadata-box th {
  font-weight: 500;
  color: var(--text-secondary);
  width: 30%;
  background: var(--background-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metadata-box td {
  color: var(--text-primary);
  width: 70%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.metadata-box td pre {
  white-space: pre-wrap;
  margin: 0;
  font-family: inherit;
}

.metadata-box td {
  max-width: 0;
}

.metadata-box td.scrollable {
  overflow-x: auto;
  white-space: nowrap;
}

.metadata-box tr:last-child th,
.metadata-box tr:last-child td {
  border-bottom: none;
}

/* Color Palette */
.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.color-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}

.color-swatch:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.color-hex {
  font-size: 0.75rem;
  font-weight: 600;
  font-family: monospace;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8), 0 0 4px rgba(0, 0, 0, 0.5);
}

/* Map Link Buttons */
.map-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.map-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.map-link-btn.gmaps {
  background-color: #3b82f6;
  color: white;
}

.map-link-btn.gmaps:hover {
  background-color: #2563eb;
  transform: translateY(-1px);
}

.map-link-btn.osm {
  background-color: #10b981;
  color: white;
}

.map-link-btn.osm:hover {
  background-color: #059669;
  transform: translateY(-1px);
}

/* Raw Tags Container & Search Box */
.raw-tags-container {
  padding: 0;
}

.raw-tags-search-box {
  position: relative;
  padding: 0.75rem 1.5rem;
  background: var(--background-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.raw-tags-search-box i {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.raw-tags-search {
  width: 100%;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.raw-tags-search:focus {
  border-color: var(--accent-color);
}

/* Footer */
.footer {
  background: var(--primary-color);
  color: white;
  padding: 2rem 0;
  margin-top: auto;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.social-icon {
  color: var(--text-secondary);
  font-size: 1.5rem;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.social-icon:hover {
  color: white;
  background: var(--accent-color);
  transform: translateY(-3px);
}

.copyright {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.metadata-box.fade {
  animation: fadeIn 0.3s ease-out forwards;
}

@keyframes float {
  0% {
    transform: translateY(0px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }

  50% {
    transform: translateY(-5px);
    box-shadow: 0 25px 25px rgba(0, 0, 0, 0.1);
  }

  100% {
    transform: translateY(0px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeScale {
  from {
    transform: scale(0.98);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
    margin: 1rem auto;
  }

  .app-header h1 {
    font-size: 2rem;
  }

  .upload-box {
    padding: 2rem 1rem;
  }

  .image-box {
    padding: 1rem;
  }

  .metadata-box th {
    width: 40%;
  }

  .metadata-box td {
    width: 60%;
  }

  .metadata-box th,
  .metadata-box td {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .nav-content,
  .footer-content {
    padding: 0 1rem;
  }

  .sticky-nav {
    padding: 0.75rem 0;
  }

  .social-icons {
    gap: 1rem;
  }

  .social-icon {
    font-size: 1.25rem;
    width: 35px;
    height: 35px;
  }

  .metadata-box summary:hover {
    background: rgba(59, 130, 246, 0.05);
    transform: none;
  }

  .section-card {
    padding: 1.5rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .step {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .step-number {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background-color);
}

::-webkit-scrollbar-thumb {
  background-color: var(--accent-color);
  border-radius: 4px;
}

/* Sticky Navigation */
.sticky-nav {
  position: sticky;
  top: 0;
  background-color: rgba(15, 23, 42, 0.98);
  /* slightly transparent */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background-color 0.3s ease;
  z-index: 1000;
}

/* Info Sections */
.info-section {
  margin: 4rem 0;
  scroll-margin-top: 80px;
}

.section-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  animation: fadeScale 0.5s ease-out;
}

.section-card h2 {
  color: var(--primary-color);
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-card h2 i {
  color: var(--accent-color);
}

.section-card p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.section-card p:last-child {
  margin-bottom: 0;
}

/* How to Use - Steps */
.step-guide {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1.5rem;
}

.step {
  display: flex;
  gap: 1.5rem;
}

.step-number {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}

.step-content h3 {
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.feature {
  padding: 1.5rem;
  background: var(--background-color);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.feature:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.feature i {
  font-size: 2rem;
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.feature h3 {
  margin-bottom: 0.75rem;
  color: var(--primary-color);
}

.feature p {
  font-size: 0.95rem;
}

/* Format List */
.format-list {
  margin: 1.5rem 0;
  padding-left: 1.25rem;
}

.format-list li {
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.format-note {
  background: rgba(59, 130, 246, 0.05);
  padding: 1rem;
  border-left: 3px solid var(--accent-color);
  border-radius: 0 8px 8px 0;
  font-style: italic;
}

/* Hamburger Menu Styles */
.hamburger-menu {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 100;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background-color: white;
  margin: 6px 0;
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
  .hamburger-menu {
    display: block;
  }

  .nav-links {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    max-width: 80vw;
    height: 100vh;
    height: 100dvh;
    background-color: var(--primary-color);
    padding: 80px 24px 24px;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s ease-in-out, visibility 0.3s ease-in-out;
    z-index: 99;
    gap: 1.5rem;
    overflow-y: auto;
  }

  .nav-links.active {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
  }

  /* Hamburger Animation */
  .hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* Add overlay when menu is open */
  .nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    z-index: 98;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* Prevent body scroll when menu is open */
  body.menu-open {
    overflow: hidden;
  }
}

@media (max-width: 480px) {
  .app-header h1 {
    font-size: 1.6rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .upload-box {
    padding: 1.75rem 1rem;
  }

  .section-card {
    padding: 1.25rem;
  }

  .section-card h2 {
    font-size: 1.4rem;
  }

  .metadata-box th {
    width: 45%;
    font-size: 0.85rem;
    padding: 0.6rem 0.75rem;
  }

  .metadata-box td {
    width: 55%;
    font-size: 0.85rem;
    padding: 0.6rem 0.75rem;
  }
}