/* DORNBACH Toolbox - Vanilla CSS */

/* ========== CSS Variables ========== */
:root {
  /* Light Theme */
  --background: hsl(0, 0%, 98%);
  --foreground: hsl(0, 0%, 29%);
  --card: hsl(0, 0%, 100%);
  --card-foreground: hsl(0, 0%, 29%);
  --primary: hsl(355, 81%, 44%);
  --primary-foreground: hsl(0, 0%, 100%);
  --secondary: hsl(0, 0%, 95%);
  --muted: hsl(0, 0%, 92%);
  --muted-foreground: hsl(0, 0%, 45%);
  --border: hsl(0, 0%, 85%);
  --radius: 0.75rem;
  
  --shadow-card: 0 4px 24px -4px hsla(0, 0%, 0%, 0.1);
  --shadow-hover: 0 8px 32px -8px hsla(355, 81%, 44%, 0.3);
}

.dark {
  --background: hsl(0, 0%, 12%);
  --foreground: hsl(0, 0%, 98%);
  --card: hsl(0, 0%, 16%);
  --card-foreground: hsl(0, 0%, 98%);
  --secondary: hsl(0, 0%, 22%);
  --muted: hsl(0, 0%, 25%);
  --muted-foreground: hsl(0, 0%, 65%);
  --border: hsl(0, 0%, 25%);
  
  --shadow-card: 0 4px 24px -4px hsla(0, 0%, 0%, 0.5);
  --shadow-hover: 0 8px 32px -8px hsla(355, 81%, 44%, 0.4);
}

/* ========== Reset ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ========== Base ========== */
html {
  font-family: 'Source Sans Pro', system-ui, sans-serif;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== Background ========== */
.background {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.background-gradient {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, hsla(355, 81%, 44%, 0.06), transparent);
}

.dark .background-gradient {
  background: radial-gradient(ellipse 80% 50% at 50% -20%, hsla(355, 81%, 44%, 0.1), transparent);
}

.background-grid {
  position: absolute;
  inset: 0;
  opacity: 0.02;
  background-image: 
    linear-gradient(hsla(355, 81%, 44%, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, hsla(355, 81%, 44%, 0.2) 1px, transparent 1px);
  background-size: 50px 50px;
}

.dark .background-grid {
  opacity: 0.04;
}

/* ========== Header ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: hsla(0, 0%, 98%, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid hsla(355, 81%, 44%, 0.2);
}

.dark .header {
  background: hsla(0, 0%, 12%, 0.8);
  box-shadow: 0 4px 30px hsla(138, 28%, 47%, 0.15);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo Section */
.logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-wrapper {
  position: relative;
}

.logo-glow {
  position: absolute;
  inset: -4px;
  background: linear-gradient(to right, hsla(355, 81%, 44%, 0.3), hsla(355, 81%, 44%, 0.1));
  border-radius: 0.5rem;
  filter: blur(4px);
  display: none;
}

.dark .logo-glow {
  display: block;
}

.logo-text {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.logo-brand {
  color: var(--foreground);
}

.logo-product {
  background: linear-gradient(to right, var(--primary), hsla(355, 81%, 44%, 0.7));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-divider {
  height: 2rem;
  width: 1px;
  background: linear-gradient(to bottom, transparent, hsla(355, 81%, 44%, 0.4), transparent);
  display: none;
}

@media (min-width: 640px) {
  .logo-divider {
    display: block;
  }
}

.logo-badge {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .logo-badge {
    display: flex;
  }
}

.logo-badge span {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: hsla(0, 0%, 29%, 0.8);
}

.dark .logo-badge span {
  color: hsla(0, 0%, 98%, 0.8);
}

.sparkle-icon {
  width: 1rem;
  height: 1rem;
  color: var(--primary);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Header Right */
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Theme Toggle */
.theme-toggle {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s;
}

.theme-toggle:hover {
  border-color: hsla(355, 81%, 44%, 0.5);
  background: hsla(355, 81%, 44%, 0.1);
}

.theme-toggle svg {
  color: var(--primary);
  transition: all 0.3s;
}

.sun-icon {
  position: absolute;
  transform: rotate(0deg) scale(1);
}

.moon-icon {
  position: absolute;
  transform: rotate(90deg) scale(0);
}

.dark .sun-icon {
  transform: rotate(-90deg) scale(0);
}

.dark .moon-icon {
  transform: rotate(0deg) scale(1);
}

/* Intranet Badge */
.intranet-badge {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: linear-gradient(to right, hsla(355, 81%, 44%, 0.2), hsla(355, 81%, 44%, 0.05));
  border: 1px solid hsla(355, 81%, 44%, 0.3);
}

@media (min-width: 768px) {
  .intranet-badge {
    display: flex;
  }
}

.dark .intranet-badge {
  box-shadow: 0 0 15px hsla(355, 81%, 44%, 0.2);
}

.shield-glow {
  position: absolute;
  inset: 0;
  background: var(--primary);
  border-radius: 9999px;
  filter: blur(4px);
  animation: pulse 2s ease-in-out infinite;
  display: none;
}

.dark .shield-glow {
  display: block;
}

.shield-icon {
  position: relative;
  width: 1rem;
  height: 1rem;
  color: var(--primary);
}

.intranet-badge span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.05em;
}

/* User Button */
.user-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.3s;
}

.user-button:hover {
  color: var(--foreground);
  background: hsla(355, 81%, 44%, 0.1);
  border-color: hsla(355, 81%, 44%, 0.2);
}

.user-text {
  display: none;
}

@media (min-width: 640px) {
  .user-text {
    display: inline;
  }
}

/* ========== Main ========== */
.main {
  padding: 6rem 1.5rem 4rem;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

/* ========== Hero ========== */
.hero {
  text-align: center;
  margin-bottom: 4rem;
  animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: var(--card);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.hero-badge svg {
  width: 1rem;
  height: 1rem;
  color: var(--primary);
}

.hero-badge span {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3rem;
  }
}

@media (min-width: 1024px) {
  .hero-title {
    font-size: 3.75rem;
  }
}

.text-gradient-burgundy {
  background: linear-gradient(135deg, hsl(355, 81%, 44%), hsl(356, 84%, 30%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dark .text-gradient-burgundy {
  filter: drop-shadow(0 0 10px hsla(197, 25%, 39%, 0.5));
}

/* ========== Filter Menu ========== */
.filter-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--card);
  backdrop-filter: blur(4px);
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--foreground);
}

.dropdown-trigger:hover {
  border-color: hsla(355, 81%, 44%, 0.5);
  background: hsla(355, 81%, 44%, 0.05);
}

.dropdown-trigger.active {
  border-color: var(--primary);
  background: hsla(355, 81%, 44%, 0.1);
  color: var(--primary);
}

.dropdown-label {
  font-weight: 500;
}

.chevron-icon {
  color: var(--primary);
  transition: transform 0.2s;
}

.dropdown.open .chevron-icon {
  transform: rotate(180deg);
}

.dropdown-content {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: 0 10px 40px -10px hsla(0, 0%, 0%, 0.2);
  backdrop-filter: blur(20px);
  display: none;
}

.dropdown.open .dropdown-content {
  display: block;
}

.dropdown-item {
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  color: var(--foreground);
}

.dropdown-item:hover {
  background: hsla(355, 81%, 44%, 0.1);
  color: var(--primary);
}

.dropdown-item.active {
  background: hsla(355, 81%, 44%, 0.1);
  color: var(--primary);
}

.dropdown-item.clear {
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
}

.dropdown-item.clear:hover {
  background: var(--muted);
}

/* Search */
.search-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--muted-foreground);
}

.search-input {
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  width: 12rem;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--foreground);
  transition: all 0.3s;
}

.search-input::placeholder {
  color: var(--muted-foreground);
}

.search-input:focus {
  outline: none;
  border-color: hsla(355, 81%, 44%, 0.5);
}

/* Reset Button */
.reset-button {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: color 0.2s;
}

.reset-button:hover {
  color: var(--primary);
}

.reset-button.hidden {
  display: none;
}

/* ========== Tiles Grid ========== */
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .tiles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .tiles-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ========== AI Tile ========== */
.ai-tile {
  position: relative;
  height: 100%;
  min-height: 160px;
  border-radius: 1rem;
  background: linear-gradient(180deg, var(--card), hsla(0, 0%, 98%, 0.8));
  border: 1px solid var(--border);
  backdrop-filter: blur(4px);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
  animation: fadeIn 0.5s ease-out forwards;
  opacity: 0;
}

.dark .ai-tile {
  background: linear-gradient(180deg, var(--card), hsla(0, 0%, 14%, 0.8));
}

.ai-tile:hover {
  border-color: hsla(355, 81%, 44%, 0.4);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.ai-tile.disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.ai-tile.disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}

/* Tile Background Pattern */
.tile-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  transition: opacity 0.5s;
}

.ai-tile:not(.disabled):hover .tile-bg {
  opacity: 0.1;
}

.tile-bg-top {
  position: absolute;
  top: 0;
  right: 0;
  width: 8rem;
  height: 8rem;
  background: linear-gradient(to bottom left, hsla(355, 81%, 44%, 0.3), transparent);
  border-radius: 9999px;
  filter: blur(32px);
}

.tile-bg-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 6rem;
  height: 6rem;
  background: linear-gradient(to top right, hsla(355, 81%, 44%, 0.2), transparent);
  border-radius: 9999px;
  filter: blur(24px);
}

/* Status Indicator */
.tile-status {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.status-dot-tile {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
}

.status-dot-tile.ready {
  background-color: #22c55e;
  animation: pulse 2s ease-in-out infinite;
}

.status-dot-tile.wip {
  background-color: #eab308;
}

.status-text {
  font-size: 0.625rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

/* Tile Content */
.tile-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Tile Icon */
.tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
  transition: all 0.3s;
  background: linear-gradient(to bottom right, var(--muted), hsla(0, 0%, 92%, 0.5));
  color: var(--muted-foreground);
}

.dark .tile-icon {
  background: linear-gradient(to bottom right, var(--muted), hsla(0, 0%, 25%, 0.5));
}

.ai-tile:not(.disabled):hover .tile-icon {
  transform: scale(1.1);
  color: var(--primary);
  background: linear-gradient(to bottom right, hsla(355, 81%, 44%, 0.15), hsla(355, 81%, 44%, 0.05));
}

.tile-icon.burgundy {
  background: linear-gradient(to bottom right, hsla(355, 81%, 44%, 0.2), hsla(355, 81%, 44%, 0.1));
  color: var(--primary);
}

.tile-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke-width: 1.5;
}

/* Tile Title */
.tile-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.375rem;
  transition: all 0.3s;
}

.ai-tile:not(.disabled):hover .tile-title {
  background: linear-gradient(to right, var(--primary), hsla(355, 81%, 44%, 0.7));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Tile Description */
.tile-description {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

/* Tile Tags */
.tile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: auto;
}

.tile-tag {
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: hsla(0, 0%, 92%, 0.5);
  border: 1px solid hsla(0, 0%, 85%, 0.5);
  font-size: 0.625rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.dark .tile-tag {
  background: hsla(0, 0%, 25%, 0.5);
  border-color: hsla(0, 0%, 25%, 0.5);
}

/* Tile Arrow */
.tile-arrow {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  opacity: 0;
  transform: translateX(0.5rem);
  transition: all 0.3s;
  pointer-events: none;
}

.ai-tile:not(.disabled):hover .tile-arrow {
  opacity: 1;
  transform: translateX(0);
}

.tile-arrow svg {
  width: 1rem;
  height: 1rem;
  color: var(--primary);
}

/* Corner Accent */
.tile-corner {
  position: absolute;
  top: 0;
  left: 0;
  width: 3rem;
  height: 3rem;
  overflow: hidden;
  border-top-left-radius: 1rem;
}

.tile-corner-inner {
  position: absolute;
  top: -1.5rem;
  left: -1.5rem;
  width: 3rem;
  height: 3rem;
  transform: rotate(45deg);
  transition: all 0.5s;
  background: linear-gradient(to right, hsla(0, 0%, 92%, 0.4), transparent);
}

.ai-tile:not(.disabled):hover .tile-corner-inner {
  background: linear-gradient(to right, hsla(355, 81%, 44%, 0.3), hsla(355, 81%, 44%, 0.1));
}

.tile-corner-inner.burgundy {
  background: linear-gradient(to right, hsla(355, 81%, 44%, 0.4), hsla(355, 81%, 44%, 0.2));
}

/* No Results */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--muted-foreground);
}

/* ========== Footer ========== */
.footer-info {
  margin-top: 4rem;
  text-align: center;
}

.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-radius: 1rem;
  background: hsla(0, 0%, 100%, 0.5);
  border: 1px solid var(--border);
}

.dark .footer-badge {
  background: hsla(0, 0%, 16%, 0.5);
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background-color: #22c55e;
  animation: pulse 2s ease-in-out infinite;
}

.footer-badge span {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* ========== Utility ========== */
.hidden {
  display: none !important;
}
