/* Base styles */
:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 240 10% 3.9%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --accent: 240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 240 5.9% 10%;
  --radius: 0.5rem;
}

.dark {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 3.9%;
  --card-foreground: 0 0% 98%;
  --popover: 240 10% 3.9%;
  --popover-foreground: 0 0% 98%;
  --primary: 0 0% 98%;
  --primary-foreground: 240 5.9% 10%;
  --secondary: 240 3.7% 15.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --accent: 240 3.7% 15.9%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 3.7% 15.9%;
  --input: 240 3.7% 15.9%;
  --ring: 240 4.9% 83.9%;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.5;
}

/* Dashboard Layout */
.dashboard-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background-color: hsl(var(--card));
  border-right: 1px solid hsl(var(--border));
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

.sidebar-header {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid hsl(var(--border));
}

.logo {
  font-size: 1.25rem;
  font-weight: bold;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: hsl(var(--foreground));
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background-color: hsl(var(--accent));
}

.light-icon {
  display: none;
}

.dark-icon {
  display: block;
}

.dark .light-icon {
  display: block;
}

.dark .dark-icon {
  display: none;
}

.sidebar-separator {
  height: 1px;
  background-color: hsl(var(--border));
  margin: 0.5rem 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu-item {
  margin-bottom: 0.25rem;
}

.sidebar-menu-button {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  text-decoration: none;
  transition: background-color 0.2s;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
}

.sidebar-menu-button:hover {
  background-color: hsl(var(--accent));
}

.sidebar-menu-button.active {
  background-color: hsl(var(--accent));
  font-weight: 500;
}

.sidebar-menu-button i {
  margin-right: 0.75rem;
  width: 1rem;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid hsl(var(--border));
}

.logout-button {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
}

.logout-button:hover {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.content {
  flex: 1;
  margin-left: 250px;
  padding: 1.5rem;
  transition: margin-left 0.3s ease;
}

.content.expanded {
  margin-left: 0;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: hsl(var(--foreground));
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  background-color: hsl(var(--accent));
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.expanded {
    transform: translateX(0);
  }

  .content {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: flex;
  }
}

/* Storage Units View */
.page-header {
  margin-bottom: 1.5rem;
}

.gradient-text {
  background: linear-gradient(to right, #3b82f6, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-muted {
  color: hsl(var(--muted-foreground));
}

.search-container {
  margin-bottom: 1.5rem;
  max-width: 500px;
}

.search-input-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
}

#search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}

.storage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.storage-card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.storage-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 100%, hsla(189, 99%, 26%, 0.2) 0px, transparent 50%);
  pointer-events: none;
}

.storage-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(to bottom right, transparent 50%, rgba(0, 200, 255, 0.1) 100%);
  border-radius: inherit;
  pointer-events: none;
}

.unit-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.unit-description {
  color: hsl(var(--muted-foreground));
  margin-bottom: 1rem;
}

.unit-price {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.separator {
  height: 1px;
  background-color: hsl(var(--border));
  margin: 1rem 0;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
}

.feature-item {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  background-color: rgba(59, 130, 246, 0.1);
  border-radius: 50%;
  margin-right: 0.5rem;
}

.feature-icon i {
  font-size: 0.625rem;
  color: #3b82f6;
}

.glow-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  background: linear-gradient(to right, #3b82f6, #06b6d4);
  color: white;
  border: none;
  border-radius: 9999px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.glow-button::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  transform: rotate(30deg);
  transition: transform 0.5s;
  pointer-events: none;
}

.glow-button:hover::before {
  transform: rotate(0deg);
}

.button-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  background: transparent;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.button-outline:hover {
  background-color: hsl(var(--accent));
}

.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

.loading-spinner i {
  font-size: 2rem;
  color: hsl(var(--primary));
}

/* Authentication Styles */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: hsl(var(--background));
}

.auth-card {
  background-color: hsl(var(--card));
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
}

.auth-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-form label {
  font-size: 0.875rem;
  font-weight: 500;
}

.auth-form input {
  padding: 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}

.auth-link {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.875rem;
}

.auth-link a {
  color: #3b82f6;
  text-decoration: underline;
}

/* User Info Styles */
.user-info {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* Profile View Styles */
.profile-view {
  max-width: 800px;
  margin: 0 auto;
}

.profile-card {
  margin-top: 1.5rem;
}

.profile-card-header {
  margin-bottom: 1.5rem;
}

.profile-card-header h2 {
  display: flex;
  align-items: center;
  font-size: 1.25rem;
}

.profile-card-header h2 i {
  margin-right: 0.5rem;
}

.profile-user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.profile-avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background-color: rgba(59, 130, 246, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar i {
  font-size: 2rem;
  color: #3b82f6;
}

.profile-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-detail-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-label {
  font-weight: 500;
  margin-right: 0.5rem;
}

.profile-form {
  margin-top: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.profile-card-footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

/* My Units View Styles */
.units-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.unit-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.unit-status {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
}

.status-active {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.status-expired {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.unit-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}

.access-code-container {
  background-color: hsl(var(--muted));
  padding: 1rem;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.access-code {
  font-family: monospace;
  font-size: 1.25rem;
  font-weight: 700;
}

.copy-button {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.copy-button i {
  margin-left: 0.25rem;
}

/* Cart View Styles */
.cart-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .cart-container {
    grid-template-columns: 2fr 1fr;
  }
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  padding: 1rem;
}

.cart-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.remove-item-button {
  background: none;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius);
}

.remove-item-button:hover {
  color: hsl(var(--destructive));
  background-color: rgba(239, 68, 68, 0.1);
}

.cart-summary {
  height: fit-content;
}

.cart-summary-header {
  margin-bottom: 1rem;
}

.cart-summary-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
}

.cart-total-row {
  font-weight: 700;
  padding-top: 0.75rem;
  border-top: 1px solid hsl(var(--border));
  margin-top: 0.25rem;
}

.cart-summary-footer {
  margin-top: 1.5rem;
}

.checkout-button {
  width: 100%;
}

.checkout-button i {
  margin-right: 0.5rem;
}

.cart-terms {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

/* Empty State Styles */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
}

.empty-state-icon {
  font-size: 4rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1.5rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  margin-bottom: 1.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Notification container with a muted green gradient */
.cart-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #3a5240, #4a6c50); /* Muted greens */
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-20px);
  box-shadow: 0 0 15px rgba(74, 108, 80, 0.6);
  width: 320px;
  overflow: hidden;
  animation: slideIn 0.5s forwards, fadeOut 0.5s 2s forwards;
}

/* Slide in animation */
@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade out animation */
@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Check mark style */
.check-mark {
  font-size: 28px;
  color: #a5d6a7; /* A softer, light green */
  margin-right: 16px;
}

/* Notification content container */
.notification-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Notification text */
.notification-text {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
  color: #e0e0e0;
}

/* Loading bar that indicates remaining time */
.loading-bar {
  height: 4px;
  background-color: rgba(165, 214, 167, 0.8); /* Softer green to match the check mark */
  border-radius: 2px;
  animation: loadBar 2s linear forwards;
}

/* Loading bar animation */
@keyframes loadBar {
  from { width: 100%; }
  to { width: 0%; }
}

