/* ===== Base Styles ===== */
:root {
  --primary: #6a11cb;
  --secondary: #2575fc;
  --accent: #ff3e9d;
  --text: #2d3748;
  --light: #f8f9fa;
  --dark: #212529;
  --gray: #6c757d;
  --light-gray: #e9ecef;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', sans-serif;
  color: var(--text);
  line-height: 1.6;
  background-color: var(--light);
  padding-top: 70px; /* For fixed navbar */
}

/* ===== Typography ===== */
h1, h2, h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
}

h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.highlight {
  color: var(--accent);
  font-weight: bold;
}

/* ===== Navigation Bar ===== */
.navbar {
  background: rgba(26, 26, 46, 0.9);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  font-family: 'Roboto', sans-serif;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
}

.logo span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  padding: 0.5rem 0;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

/* ===== Hero Section ===== */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  text-align: center;
  padding: 6rem 2rem 4rem;
  position: relative;
  overflow: hidden;
  animation: gradientShift 15s ease infinite;
  background-size: 200% 200%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -50px;
  left: 0;
  right: 0;
  height: 100px;
  background: var(--light);
  transform: skewY(-2deg);
  z-index: 1;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===== Container ===== */
.container {
  max-width: 1200px;
  margin: 3rem auto;
  padding: 0 2rem;
}

/* ===== Search Section ===== */
.search-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
}

.search-info {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.search-info ul {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.search-info li {
  margin-bottom: 0.5rem;
}

.search-box {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.search-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.search-controls input {
  flex: 1;
  padding: 1rem;
  border: 1px solid var(--light-gray);
  border-radius: 5px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.search-controls input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(106, 17, 203, 0.2);
}

.search-tip {
  color: var(--gray);
  font-size: 0.9rem;
  font-style: italic;
}

/* ===== CTA Button ===== */
.cta-button {
  display: inline-block;
  background-color: var(--accent);
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  cursor: pointer;
  white-space: nowrap;
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.cta-button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* ===== Results Section ===== */
.results-container {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  margin-bottom: 3rem;
}

.placeholder, .loading, .no-results {
  text-align: center;
  padding: 2rem;
  color: var(--gray);
}

.results-header {
  margin-bottom: 2rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.patent-card {
  background: white;
  border: 1px solid var(--light-gray);
  border-radius: 8px;
  padding: 1.5rem;
  transition: transform 0.3s, box-shadow 0.3s;
}

.patent-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.patent-id {
  font-family: 'Roboto Mono', monospace;
  color: var(--primary);
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.patent-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--dark);
}

.patent-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--gray);
  margin-bottom: 1.5rem;
}

.patent-details-button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
  width: 100%;
}

.patent-details-button:hover {
  background: var(--secondary);
}

.error-message {
  background: #fff0f0;
  border-left: 4px solid #ff6b6b;
  padding: 1.5rem;
  color: #d32f2f;
}

.error-message pre {
  background: white;
  padding: 1rem;
  border-radius: 5px;
  overflow-x: auto;
  margin-top: 1rem;
}

/* ===== Cookie Banner ===== */
.cookie-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 1rem;
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.cookie-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1200px;
  width: 100%;
  padding: 0 2rem;
}

.cookie-content p {
  margin: 0;
  flex: 1;
}

.cookie-button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}

.cookie-button:hover {
  background: #ff2d8e;
}

/* ===== Footer ===== */
.footer {
  background: var(--dark);
  color: white;
  padding: 2rem;
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.home-link {
  color: white;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 1rem;
  transition: color 0.3s;
}

.home-link:hover {
  color: var(--accent);
}

/* ===== Responsive Design ===== */
@media (max-width: 900px) {
  .search-section {
    grid-template-columns: 1fr;
  }
  
  .hero {
    padding: 5rem 1rem 3rem;
  }
  
  h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 600px) {
  .search-controls {
    flex-direction: column;
  }
  
  .cookie-content {
    flex-direction: column;
    text-align: center;
  }
  
  .navbar {
    padding: 1rem;
  }
  
  .nav-links {
    gap: 1rem;
  }
}