/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 */

/* ===== Button Styles ===== */
.btn {
  @apply inline-flex items-center justify-center px-4 py-2 rounded-lg font-semibold transition-colors no-underline;
}

.btn-primary {
  @apply bg-blue-600 text-white hover:bg-blue-700 disabled:bg-gray-400;
}

.btn-secondary {
  @apply bg-gray-200 text-gray-900 hover:bg-gray-300 disabled:bg-gray-100;
}

.btn-danger {
  @apply bg-red-600 text-white hover:bg-red-700 disabled:bg-gray-400;
}

.btn-sm {
  @apply px-3 py-1 text-sm;
}

/* ===== Form Styles ===== */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  @apply border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition;
}

/* Trix container wrapper */
trix-toolbar + .trix-editor {
  border-top: none;
}

/* ===== Rich Text Editor (Trix) ===== */
trix-toolbar {
  margin-bottom: 0;
  background: #ffffff;
  padding: 6px 10px;
  border: none;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 10px 10px 0 0;
}

trix-toolbar .trix-button-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  align-items: center;
}

trix-toolbar .trix-button-group {
  display: flex;
  gap: 0;
  padding: 0 2px;
  border-right: 1px solid #e5e7eb;
  margin-right: 4px;
}

trix-toolbar .trix-button-group:last-child {
  border-right: none;
  margin-right: 0;
}

trix-toolbar .trix-button {
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #1f2937;
  background: transparent;
  border-right: none;
  border-radius: 3px;
  transition: background-color 0.12s ease;
  font-size: 0 !important;
  line-height: 0;
  margin: 0 !important;
}

trix-toolbar .trix-button::before {
  font-size: 16px !important;
  color: #1f2937 !important;
  opacity: 1 !important;
  line-height: 1;
}

trix-toolbar .trix-button:hover {
  background: #e5e7eb;
  color: #111827;
}

trix-toolbar .trix-button:hover::before {
  color: #111827 !important;
}

trix-toolbar .trix-button:hover::before {
  opacity: 1;
}

trix-toolbar .trix-button:last-child {
  border-right: 0;
}

trix-toolbar .trix-button.trix-active {
  background: #dbeafe;
  color: #1e40af;
}

trix-toolbar .trix-button.trix-active::before {
  color: #1e40af;
}

trix-toolbar .trix-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

trix-toolbar .trix-button--icon {
  width: 28px !important;
  height: 28px !important;
}

.trix-editor {
  border: 1px solid #e5e7eb;
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 16px;
  min-height: 320px;
  background: #ffffff;
  color: #1f2937;
  line-height: 1.65;
  font-size: 1rem;
  font-family: "Inter", system-ui, sans-serif;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: text;
}

.trix-editor:empty:not(:focus)::before {
  color: #9ca3af !important;
  font-style: italic;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.trix-editor:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: #ffffff;
}

.trix-editor:hover {
  border-color: #6793b3;
}

.trix-editor h1 {
  font-family: "Playfair Display", serif;
  color: #1f4257;
}

.trix-editor a {
  color: #355f7f;
  text-decoration: underline;
}

/* ===== Prose (Rich Text Content) ===== */
.prose {
  @apply max-w-none;
}

.prose h1 {
  @apply text-2xl font-serif font-bold text-navy-700 mt-6 mb-3;
}

.prose h2 {
  @apply text-xl font-serif font-bold text-navy-700 mt-5 mb-2;
}

.prose p {
  @apply mb-4 leading-relaxed text-navy-800;
}

.prose strong {
  @apply font-semibold text-navy-900;
}

/* ===== Global Enhancements ===== */
* {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

html {
  scroll-behavior: smooth;
}

/* ===== Link Styling ===== */
a {
  text-decoration: none;
  color: inherit;
}

a:focus-visible {
  outline: 2px solid #355f7f;
  outline-offset: 2px;
}

/* ===== Input and Form Enhancements ===== */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  transform: translateY(-1px);
}

/* ===== Button Enhancements ===== */
button,
.btn,
a[class*="btn"] {
  transition: all 0.2s ease;
  cursor: pointer;
}

button:active,
.btn:active,
a[class*="btn"]:active {
  transform: scale(0.98);
}

/* ===== Shadow Elevation System ===== */
.shadow-elevation-1 {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.shadow-elevation-2 {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12);
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f9fafb;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #d9e4ec;
  border-radius: 10px;
  border: 2px solid #f9fafb;
}

::-webkit-scrollbar-thumb:hover {
  background: #b3c9d9;
}

/* ===== Selection Styling ===== */
::selection {
  background-color: #355f7f;
  color: #ffffff;
}

::-moz-selection {
  background-color: #355f7f;
  color: #ffffff;
}

/* ===== Text Rendering ===== */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ===== Image Optimization ===== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== Focus States for Accessibility ===== */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
}

/* ===== File Upload Styling ===== */
.file-upload-area {
  position: relative;
  min-height: 120px;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  background: #f9fafb;
  transition: all 0.3s ease;
  cursor: pointer;
}

.file-upload-area:hover {
  border-color: #355f7f;
  background: #f3f4f6;
}

.file-upload-area input[type="file"] {
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* Enhanced file input button styling */
input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: #1f4257;
  color: white;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

input[type="file"]::file-selector-button:hover {
  background: #2d5a73;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(31, 66, 87, 0.2);
}

input[type="file"]::file-selector-button:active {
  transform: translateY(0);
}

/* Media upload sections */
.media-upload-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.media-upload-card:hover {
  border-color: #355f7f;
  box-shadow: 0 4px 12px rgba(53, 95, 127, 0.1);
  transform: translateY(-2px);
}

.media-upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f3f4f6;
}

.media-upload-icon {
  font-size: 32px;
  margin-right: 12px;
}

/* Submit button enhancement */
.btn-submit-letter {
  padding: 16px 40px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 12px;
  background: linear-gradient(135deg, #1f4257 0%, #355f7f 100%);
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(31, 66, 87, 0.3);
}

.btn-submit-letter:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(31, 66, 87, 0.4);
}

.btn-submit-letter:active {
  transform: translateY(0);
}

/* Record button enhancement */
.btn-record {
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  background: #dc2626;
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.btn-record:hover {
  background: #b91c1c;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.btn-record.recording {
  background: #15803d;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.prose em {
  @apply italic text-navy-700;
}

.prose ul {
  @apply list-disc list-inside mb-4 text-navy-800;
}

.prose ol {
  @apply list-decimal list-inside mb-4 text-navy-800;
}

.prose blockquote {
  @apply border-l-4 border-navy-300 pl-4 italic text-navy-600 my-4 bg-cream-50 py-2;
}

.prose a {
  @apply text-navy-600 underline hover:text-navy-800 transition-colors;
}

.prose code {
  @apply bg-cream-100 text-navy-700 px-2 py-1 rounded text-sm font-mono;
}

/* ===== Utility Classes ===== */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Action Text Styles ===== */
.attachment {
  @apply my-2 p-2 bg-gray-100 rounded-lg;
}

.attachment-gallery {
  @apply flex flex-wrap gap-2;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .btn {
    @apply text-sm;
  }
  
  .container {
    @apply px-2;
  }
}
 * It is generally better to create a new file per style scope.
 *
 *= require_tree .
 *= require_self
 */
