* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --warm-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --cool-gradient: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  --dark-gradient: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.18);
  --text-dark: #2d3748;
  --text-light: #718096;
  --text-muted: #a0aec0;
  --success-color: #48bb78;
  --warning-color: #ed8936;
  --error-color: #f56565;
  --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 20px 40px rgba(0, 0, 0, 0.15);
  --shadow-strong: 0 30px 60px rgba(0, 0, 0, 0.2);
}

body {
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="20" cy="80" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
  z-index: 1;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 2;
}

/* Navigation */
.navbar {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 15px 30px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-soft);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: "Playfair Display", serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 8px 16px;
  border-radius: 25px;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 5px;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: white;
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100vh;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  z-index: 999;
  transition: left 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu.active {
  left: 0;
}

.mobile-menu-content {
  text-align: center;
}

.mobile-menu-link {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-dark);
  text-decoration: none;
  margin: 20px 0;
  padding: 15px 30px;
  border-radius: 50px;
  transition: all 0.3s ease;
}

.mobile-menu-link:hover {
  background: var(--primary-gradient);
  color: white;
  transform: translateY(-2px);
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 60px;
  color: white;
}

.header h1 {
  font-family: "Playfair Display", serif;
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
  background: linear-gradient(45deg, #ffffff, #f0f8ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
  }
  to {
    filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.5));
  }
}

.header p {
  font-size: 1.3rem;
  opacity: 0.95;
  font-weight: 400;
  max-width: 600px;
  margin: 0 auto;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Main Content */
.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  margin-bottom: 60px;
}

.upload-section,
.results-section {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 25px;
  padding: 40px;
  box-shadow: var(--shadow-medium);
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.upload-section::before,
.results-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
  border-radius: 25px 25px 0 0;
}

.upload-section:hover,
.results-section:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-strong);
  border-color: rgba(255, 255, 255, 0.3);
}

.section-title {
  font-family: "Playfair Display", serif;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 30px;
  color: white;
  text-align: center;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Upload Area */
.upload-area {
  border: 3px dashed rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  padding: 50px 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.4s ease;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.upload-area::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: rotate 4s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.upload-area:hover::before {
  opacity: 1;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.upload-area:hover {
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.02);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.upload-area.dragover {
  border-color: #4facfe;
  background: rgba(79, 172, 254, 0.2);
  transform: scale(1.05);
  box-shadow: 0 20px 40px rgba(79, 172, 254, 0.3);
}

.upload-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  transition: all 0.3s ease;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
  position: relative;
  z-index: 2;
}

.upload-area:hover .upload-icon {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.4));
}

.upload-text {
  font-size: 1.2rem;
  color: white;
  margin-bottom: 10px;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 2;
}

.upload-subtext {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 2;
}

#imageInput {
  display: none;
}

.uploaded-image {
  max-width: 100%;
  max-height: 350px;
  border-radius: 15px;
  margin-top: 25px;
  box-shadow: var(--shadow-medium);
  transition: all 0.3s ease;
}

.uploaded-image:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-strong);
}

/* Analyze Button */
.analyze-btn {
  width: 100%;
  padding: 18px 40px;
  background: var(--secondary-gradient);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.4s ease;
  margin-top: 25px;
  text-transform: uppercase;
  letter-spacing: 2px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.analyze-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.analyze-btn:hover::before {
  left: 100%;
}

.analyze-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-medium);
  background: var(--warm-gradient);
}

.analyze-btn:active {
  transform: translateY(-1px);
}

.analyze-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  background: var(--dark-gradient);
}

/* Loading Animation */
.loading {
  display: none;
  text-align: center;
  padding: 30px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  margin-top: 20px;
  backdrop-filter: blur(10px);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #4facfe;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
  box-shadow: 0 0 20px rgba(79, 172, 254, 0.5);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: white;
  font-size: 1.1rem;
  font-weight: 500;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-top: 25px;
}

.suggestion-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.suggestion-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.suggestion-card:hover::before {
  transform: scaleX(1);
}

.suggestion-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-strong);
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
}

.suggestion-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
  transition: all 0.3s ease;
}

.suggestion-card:hover .suggestion-icon {
  transform: scale(1.1) rotate(5deg);
}

.suggestion-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.suggestion-description {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 30px;
  color: rgba(255, 255, 255, 0.8);
}

.empty-state-icon {
  font-size: 5rem;
  margin-bottom: 25px;
  filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.3));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.empty-state-text {
  font-size: 1.4rem;
  margin-bottom: 15px;
  font-weight: 600;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.empty-state-subtext {
  font-size: 1.1rem;
  opacity: 0.9;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Back Button */
.back-btn {
  position: fixed;
  top: 30px;
  left: 30px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-soft);
  z-index: 1000;
}

.back-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  background: rgba(255, 255, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .main-content {
    gap: 40px;
  }

  .header h1 {
    font-size: 3.5rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .main-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .header h1 {
    font-size: 2.8rem;
  }

  .header p {
    font-size: 1.1rem;
  }

  .upload-section,
  .results-section {
    padding: 30px;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .back-btn {
    top: 20px;
    left: 20px;
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 15px;
  }

  .header h1 {
    font-size: 2.2rem;
  }

  .upload-section,
  .results-section {
    padding: 25px;
  }

  .upload-area {
    padding: 40px 20px;
  }

  .section-title {
    font-size: 1.6rem;
  }
}

/* Animations */
.fade-in {
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .upload-section:hover,
  .results-section:hover,
  .suggestion-card:hover {
    transform: none;
  }

  .upload-section:active,
  .results-section:active {
    transform: translateY(-4px);
  }

  .suggestion-card:active {
    transform: translateY(-4px) scale(1.01);
  }

  .analyze-btn:hover {
    transform: none;
  }

  .analyze-btn:active {
    transform: translateY(-2px);
  }
}
