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

body {
  font-family: 'Courier New', monospace;
  background: linear-gradient(135deg, #1a0033 0%, #0d1b2a 50%, #1b263b 100%);
  color: #e0e0ff;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 50%, rgba(138, 43, 226, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(75, 0, 130, 0.15) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 0, 51, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(138, 43, 226, 0.3);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  box-shadow: 0 4px 16px rgba(138, 43, 226, 0.2);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 200px;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(167, 139, 250, 0.5);
}

.greeting {
  font-size: 0.85rem;
  color: #9ca3af;
}

.header-center {
  flex: 1;
  max-width: 500px;
}

#globalSearch {
  width: 100%;
  padding: 0.75rem 1.25rem;
  background: rgba(30, 0, 60, 0.5);
  border: 1px solid rgba(138, 43, 226, 0.4);
  border-radius: 24px;
  color: #e0e0ff;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s;
}

#globalSearch::placeholder {
  color: #6b7280;
}

#globalSearch:focus {
  border-color: #a78bfa;
  box-shadow: 0 0 16px rgba(167, 139, 250, 0.3);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 200px;
  justify-content: flex-end;
}

#clock {
  font-size: 1.1rem;
  color: #a78bfa;
  letter-spacing: 1px;
}

button {
  padding: 0.65rem 1.25rem;
  background: rgba(138, 43, 226, 0.2);
  border: 1px solid rgba(138, 43, 226, 0.5);
  border-radius: 8px;
  color: #e0e0ff;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

button:hover {
  background: rgba(138, 43, 226, 0.4);
  box-shadow: 0 0 12px rgba(138, 43, 226, 0.4);
  transform: translateY(-2px);
}

button.active {
  background: rgba(236, 72, 153, 0.3);
  border-color: #ec4899;
}

main {
  padding: 2rem;
  max-width: 1600px;
  margin: 0 auto;
}

.controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

#categoriesGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.category-card {
  background: rgba(30, 0, 60, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(138, 43, 226, 0.3);
  border-radius: 16px;
  padding: 1.5rem;
  max-height: 400px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.3s;
}

.category-card:hover {
  border-color: #a78bfa;
  box-shadow: 0 8px 32px rgba(138, 43, 226, 0.4);
  transform: translateY(-4px);
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(138, 43, 226, 0.3);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.category-title {
  font-size: 1.2rem;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.category-order-controls {
  display: flex;
  gap: 0.25rem;
}

.order-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  background: rgba(138, 43, 226, 0.2);
  border: 1px solid rgba(138, 43, 226, 0.4);
  border-radius: 4px;
  color: #a78bfa;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: none;
  letter-spacing: 0;
}

.order-btn:hover {
  background: rgba(138, 43, 226, 0.4);
  box-shadow: 0 0 8px rgba(138, 43, 226, 0.3);
  transform: translateY(-1px);
}

.bookmarks-list {
  overflow-y: auto;
  flex: 1;
}

.bookmarks-list::-webkit-scrollbar {
  width: 6px;
}

.bookmarks-list::-webkit-scrollbar-track {
  background: rgba(138, 43, 226, 0.1);
  border-radius: 3px;
}

.bookmarks-list::-webkit-scrollbar-thumb {
  background: rgba(138, 43, 226, 0.4);
  border-radius: 3px;
}

.bookmark-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: rgba(138, 43, 226, 0.1);
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.bookmark-item:hover {
  background: rgba(138, 43, 226, 0.2);
  border-color: rgba(138, 43, 226, 0.4);
}

.bookmark-link {
  color: #e0e0ff;
  text-decoration: none;
  flex: 1;
  font-size: 0.95rem;
}

.bookmark-link:hover {
  color: #a78bfa;
}

.delete-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}

.delete-btn:hover {
  background: rgba(239, 68, 68, 0.4);
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: rgba(26, 0, 51, 0.95);
  border: 1px solid rgba(138, 43, 226, 0.5);
  border-radius: 16px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 16px 64px rgba(138, 43, 226, 0.3);
}

.modal-content h2 {
  margin-bottom: 1.5rem;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #9ca3af;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  background: rgba(30, 0, 60, 0.5);
  border: 1px solid rgba(138, 43, 226, 0.4);
  border-radius: 8px;
  color: #e0e0ff;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
}

.form-group input:focus {
  outline: none;
  border-color: #a78bfa;
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.3);
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

footer {
  background: rgba(26, 0, 51, 0.7);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(138, 43, 226, 0.3);
  padding: 2rem;
  text-align: center;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.weather-placeholder, .quote-placeholder {
  color: #9ca3af;
  font-size: 0.9rem;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #9ca3af;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #6b7280;
}

.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.auth-container h2 {
  margin-bottom: 2rem;
  color: #a78bfa;
  font-size: 2rem;
}

.denied-message {
  color: #ef4444;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .header-left, .header-center, .header-right {
    width: 100%;
    min-width: unset;
    max-width: unset;
  }

  .header-right {
    justify-content: center;
  }

  #categoriesGrid {
    grid-template-columns: 1fr;
  }
}
