/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

@import "actiontext.css";
@import "darkmode.css";
@import "components/navbar.css";

/* Override only the main page backgrounds for light theme, preserve navbar and other components */
[data-theme="light"] {
  --color-base-200: oklch(93% 0 0); /* Use grey for main page background */
}

/* Avatar utility classes for consistent sizing and responsiveness */
.avatar-fixed-size {
  flex-shrink: 0 !important;
  object-fit: cover !important;
  overflow: hidden !important;
}

.avatar-initials {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1 !important;
  font-weight: bold !important;
}

/* Dark mode compatibility - ensure avatars work in both themes */
[data-theme="dark"] .avatar-initials {
  color: white !important;
}

[data-theme="light"] .avatar-initials {
  color: white !important;
}

/* Specifically target the page content area to use grey background */
[data-theme="light"] .min-h-screen {
  background-color: oklch(93% 0 0) !important;
}

/* Cabinet title links - force white text on gradient backgrounds regardless of theme */
.cabinet-title-link {
  color: white !important;
}

.cabinet-title-link:hover {
  color: rgba(255, 255, 255, 0.8) !important;
}

:root {
  --font-family-base: "SF Pro Text", "Trebuchet MS", Arial, sans-serif;
  --font-family-monospace: ui-monospace, SFMono-Regular, "SF Mono", Menlo,
    monospace;
  --color-primary-600: #4361ee;
}

body {
  font-family: var(--font-family-base);
  margin-top: 100px;
}

.navbar{
  position: fixed;
  top: 0;
  z-index: 1000;
}

/* PWA Offline Styles */
.is-offline {
  filter: grayscale(0.3);
}

.is-offline::before {
  content: "Offline Mode";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #f59e0b;
  color: white;
  text-align: center;
  padding: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
}

/* Custom Shadow Effects for Modern UI */
.shadow-card {
  box-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgba(0, 0, 0, 0.05)), 0 4px 6px -2px var(--tw-shadow-color, rgba(0, 0, 0, 0.025));
  background-color: var(--color-base-100);
  border: 1px solid var(--color-base-300);
  color: var(--color-base-content);
}

.shadow-soft {
  box-shadow: 0 4px 6px var(--tw-shadow-color, rgba(0, 0, 0, 0.05)), 0 1px 3px var(--tw-shadow-color, rgba(0, 0, 0, 0.02));
}

/* Custom Color Classes using DaisyUI semantic colors */
.text-blue-600 {
  color: var(--color-primary);
}

.bg-blue-600 {
  background-color: var(--color-primary);
}

.text-gray-800 {
  color: var(--color-base-content);
}

.text-gray-700 {
  color: var(--color-base-content);
  opacity: 0.8;
}

.text-gray-500 {
  color: var(--color-base-content);
  opacity: 0.6;
}

.text-gray-400 {
  color: var(--color-base-content);
  opacity: 0.5;
}

.border-gray-200 {
  border-color: var(--color-base-300);
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

/* PWA Install Prompt Styles */
.pwa-install-banner {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pwa-install-banner button:hover {
  transform: translateY(-1px);
}

/* Loading states for PWA features */
.pwa-loading {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}

.pwa-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Custom shadows */
.shadow-soft {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.shadow-card {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* Enhanced notification styles */
.notification-toast {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
}

/* Responsive PWA adjustments */
@media (display-mode: standalone) {
  /* Styles for when app is installed as PWA */
  body {
    margin-top: 80px; /* Adjust for native app look */
  }
  
  .navbar {
    border-bottom: none;
    box-shadow: none;
  }
}

@media (max-width: 768px) {
  /* Mobile-specific PWA styles */
  .pwa-install-banner {
    margin: 0 16px;
    border-radius: 12px;
  }
  
  .notification-toast {
    margin: 0 16px;
    border-radius: 12px;
  }
}

/* Trix editor improvements for comment forms */
.trix-container trix-editor {
  border: 1px solid var(--color-base-300);
  border-radius: 0.5rem;
  padding: 0.75rem;
  min-height: 100px;
  outline: none;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  background: var(--color-base-100);
  color: var(--color-base-content);
}

.trix-container trix-editor:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb, 67, 97, 238), 0.1);
}

.trix-container trix-toolbar {
  border: 1px solid var(--color-base-300);
  border-bottom: none;
  border-radius: 0.5rem 0.5rem 0 0;
  background: var(--color-base-200);
}

.trix-container trix-toolbar .trix-button-group {
  border-right: 1px solid var(--color-base-300);
}

.trix-container trix-toolbar .trix-button {
  background: transparent;
  border: none;
  color: var(--color-base-content);
  opacity: 0.7;
  padding: 0.5rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease-in-out, opacity 0.2s ease-in-out;
}

.trix-container trix-toolbar .trix-button svg,
.trix-container trix-toolbar .trix-button::before {
  color: var(--color-base-content);
  fill: var(--color-base-content);
}

.trix-container trix-toolbar .trix-button:hover,
.trix-container trix-toolbar .trix-button.trix-active {
  background-color: var(--color-base-300);
  opacity: 1;
  color: var(--color-base-content);
}

.trix-container trix-toolbar .trix-button:hover svg,
.trix-container trix-toolbar .trix-button.trix-active svg,
.trix-container trix-toolbar .trix-button:hover::before,
.trix-container trix-toolbar .trix-button.trix-active::before {
  color: var(--color-base-content);
  fill: var(--color-base-content);
}

/* Comment highlight effect */
.comment-highlighted {
  position: relative;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 50%, rgba(59, 130, 246, 0.1) 100%) !important;
  border-left: 3px solid rgba(59, 130, 246, 0.6) !important;
  border-radius: 8px !important;
  animation: highlightPulse 1s ease-in-out;
  transition: all 2s ease-out;
  transform: scale(1.005);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2), 0 2px 8px rgba(59, 130, 246, 0.1) !important;
}

.comment-highlighted::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, 
    rgba(59, 130, 246, 0.2), 
    rgba(147, 197, 253, 0.2), 
    rgba(59, 130, 246, 0.2), 
    rgba(147, 197, 253, 0.2)
  );
  background-size: 400% 400%;
  animation: gradientShift 2s ease-in-out;
  border-radius: 10px;
  z-index: -1;
}

@keyframes highlightPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
  }
  25% {
    transform: scale(1.005);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
  }
  50% {
    transform: scale(1.008);
    box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.1);
  }
  75% {
    transform: scale(1.005);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
  }
  100% {
    transform: scale(1.005);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2), 0 2px 8px rgba(59, 130, 246, 0.1);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
    opacity: 0.8;
  }
  50% {
    background-position: 100% 50%;
    opacity: 0.4;
  }
  100% {
    background-position: 0% 50%;
    opacity: 0;
  }
}