/* ============================================
   ClariPi Site - Custom Styles
   ============================================ */

/* Dark Mode Base */
html, body {
  background-color: #020617;
  color: #f1f5f9;
}

/* Glass Card Effect */
.glass-card {
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.glass-card:hover {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(0, 162, 255, 0.3);
}

/* Text Gradient */
.text-gradient {
  background: linear-gradient(135deg, #00a2ff 0%, #0077cc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: bold;
}

/* Input Dark Style */
.input-dark {
  background-color: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #f1f5f9;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.input-dark:focus {
  background-color: rgba(30, 41, 59, 0.95);
  border-color: #00a2ff;
  outline: none;
  box-shadow: 0 0 15px rgba(0, 162, 255, 0.3);
}

.input-dark::placeholder {
  color: rgba(148, 163, 184, 0.6);
}

/* Background Grid */
.bg-grid {
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* Hamburger Button */
.hamburger-btn {
  font-size: 1.5rem;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger-btn:hover {
  color: #00a2ff;
  transform: scale(1.1);
}

/* Mobile Menu Styles */
#mobile-menu {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s ease;
}

#mobile-menu.show {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Language button active state */
.lang-btn.active {
  opacity: 1 !important;
  filter: brightness(1.2);
}

/* Utility: No wrap */
.whitespace-nowrap {
  white-space: nowrap;
}

/* Form Success State */
.form-success {
  background-color: rgba(34, 197, 94, 0.1);
  border-color: #22c55e;
  color: #22c55e;
}

.form-error {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}

/* Table styling */
table {
  border-collapse: collapse;
}

table th,
table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

table th {
  background-color: rgba(15, 23, 42, 0.5);
  font-weight: 600;
  color: #f1f5f9;
}

table tbody tr:hover {
  background-color: rgba(15, 23, 42, 0.3);
}

/* Image Comparison Slider */
.img-comp-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: auto;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background-color: #000;
}

.img-comp-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
}

.img-comp-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #000;
}

.img-comp-img-base {
  position: relative;
  z-index: 1;
}

.img-comp-img-overlay {
  position: absolute;
  z-index: 2;
  overflow: hidden;
  transition: clip-path 0.1s ease;
}

.img-comp-img-overlay img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.slider-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background-color: #00a2ff;
  cursor: ew-resize;
  transform: translateX(-50%);
  z-index: 10;
  box-shadow: 0 0 20px rgba(0, 162, 255, 0.6), 
              -20px 0 30px rgba(0, 162, 255, 0.2),
              20px 0 30px rgba(0, 162, 255, 0.2);
}

.slider-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background-color: #00a2ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  box-shadow: 0 0 25px rgba(0, 162, 255, 0.8);
  transition: transform 0.2s ease;
}

.slider-button:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .img-comp-container {
    aspect-ratio: 4 / 3;
  }

  .slider-button {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

/* Animation: Fade In */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Loading state */
.loading {
  pointer-events: none;
  opacity: 0.6;
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #00a2ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid #00a2ff;
  outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #00a2ff;
  color: white;
  padding: 8px;
  z-index: 100;
  text-decoration: none;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}
