/*
 * 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.
 */

/* TheAdmin Theme inspired styles for translation management */
.btn {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  margin-bottom: 0;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  transition: all 0.15s ease-in-out;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 0.2rem;
}

.btn-xs {
  padding: 0.125rem 0.375rem;
  font-size: 0.6875rem;
  border-radius: 0.15rem;
}

.btn-primary {
  color: #fff;
  background-color: var(--primary-color, #1f2937);
  border-color: var(--primary-color, #1f2937);
}

.btn-primary:hover {
  color: #fff;
  filter: brightness(0.85);
}

.btn-secondary {
  color: #fff;
  background-color: #6c757d;
  border-color: #6c757d;
}

.btn-secondary:hover {
  color: #fff;
  background-color: #545b62;
  border-color: #4e555b;
}

.btn-success {
  color: #fff;
  background-color: #28a745;
  border-color: #28a745;
}

.btn-success:hover {
  color: #fff;
  background-color: #1e7e34;
  border-color: #1c7430;
}

.btn-outline-primary {
  color: var(--primary-color, #1f2937);
  background-color: transparent;
  border-color: var(--primary-color, #1f2937);
}

.btn-outline-primary:hover {
  color: #fff;
  background-color: var(--primary-color, #1f2937);
  border-color: var(--primary-color, #1f2937);
}

.btn-outline-secondary {
  color: #6c757d;
  background-color: transparent;
  border-color: #6c757d;
}

.btn-outline-secondary:hover {
  color: #fff;
  background-color: #6c757d;
  border-color: #6c757d;
}

.btn-outline-danger {
  color: #dc3545;
  background-color: transparent;
  border-color: #dc3545;
}

.btn-outline-danger:hover {
  color: #fff;
  background-color: #dc3545;
  border-color: #dc3545;
}

.btn-outline-success {
  color: #28a745;
  background-color: transparent;
  border-color: #28a745;
}

.btn-outline-success:hover {
  color: #fff;
  background-color: #28a745;
  border-color: #28a745;
}

.btn-outline-light {
  color: #f8f9fa;
  background-color: transparent;
  border-color: #f8f9fa;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: #fff;
  background-clip: border-box;
  border: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 0.25rem;
}

.card-header {
  padding: 0.75rem 1.25rem;
  margin-bottom: 0;
  background-color: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
  border-top-left-radius: calc(0.25rem - 1px);
  border-top-right-radius: calc(0.25rem - 1px);
}

.card-body {
  flex: 1 1 auto;
  padding: 1.25rem;
}

.card-title {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  font-weight: 500;
}

.badge {
  display: inline-block;
  padding: 0.25em 0.4em;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
}

.badge-success {
  color: #fff;
  background-color: #28a745;
}

.badge-warning {
  color: #212529;
  background-color: #ffc107;
}

.badge-danger {
  color: #fff;
  background-color: #dc3545;
}

.btn-group {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
}

.btn-group > .btn {
  position: relative;
  flex: 1 1 auto;
}

.btn-group > .btn:not(:first-child) {
  margin-left: -1px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.btn-group > .btn:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.border-success {
  border-color: #28a745 !important;
}

.bg-light-success {
  background-color: rgba(40, 167, 69, 0.1) !important;
}

.border-warning {
  border-color: #ffc107 !important;
}

.bg-light-warning {
  background-color: rgba(255, 193, 7, 0.1) !important;
}

.border-danger {
  border-color: #dc3545 !important;
}

.bg-light-danger {
  background-color: rgba(220, 53, 69, 0.1) !important;
}

.border-light {
  border-color: #dee2e6 !important;
}

.text-muted {
  color: #6c757d !important;
}

.text-danger {
  color: #dc3545 !important;
}

.text-warning {
  color: #ffc107 !important;
}

.text-info {
  color: #17a2b8 !important;
}

.font-weight-medium {
  font-weight: 500 !important;
}

.d-flex {
  display: flex !important;
}

.align-items-center {
  align-items: center !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-6 { margin-bottom: 3rem !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 1rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }

.p-3 { padding: 1rem !important; }

.rounded { border-radius: 0.25rem !important; }

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

.col-md-4 {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
  padding-right: 15px;
  padding-left: 15px;
}

.col-sm-6 {
  flex: 0 0 50%;
  max-width: 50%;
}

@media (max-width: 767.98px) {
  .col-sm-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  .col-md-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Alert styles */
.alert {
  position: relative;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.25rem;
}

.alert-info {
  color: #0c5460;
  background-color: #d1ecf1;
  border-color: #bee5eb;
}

.alert-danger {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

.alert-heading {
  color: inherit;
  font-size: 1.25rem;
  font-weight: 500;
}

/* Spinner styles */
.spinner-border {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  vertical-align: text-bottom;
  border: 0.25em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.2em;
}

@keyframes spinner-border {
  to {
    transform: rotate(360deg);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Flag icons placeholder */
.flag-icon {
  display: inline-block;
  width: 20px;
  height: 15px;
  background-size: cover;
  background-position: center;
  border-radius: 2px;
}

.flag-icon-us { background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTUiIHZpZXdCb3g9IjAgMCAyMCAxNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjIwIiBoZWlnaHQ9IjE1IiBmaWxsPSIjMDA0RDlGIi8+CjxyZWN0IHdpZHRoPSIyMCIgaGVpZ2h0PSIxLjE1IiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K'); }

.flag-icon-jp { background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTUiIHZpZXdCb3g9IjAgMCAyMCAxNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjIwIiBoZWlnaHQ9IjE1IiBmaWxsPSJ3aGl0ZSIvPgo8Y2lyY2xlIGN4PSIxMCIgY3k9IjcuNSIgcj0iNCIgZmlsbD0iI0JEMDM0RSIvPgo8L3N2Zz4K'); }

.flag-icon-cn { background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTUiIHZpZXdCb3g9IjAgMCAyMCAxNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjIwIiBoZWlnaHQ9IjE1IiBmaWxsPSIjREUyOTEwIi8+Cjwvc3ZnPgo='); }

.flag-icon-es { background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTUiIHZpZXdCb3g9IjAgMCAyMCAxNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjIwIiBoZWlnaHQ9IjE1IiBmaWxsPSIjQUE3NTE1Ii8+Cjwvc3ZnPgo='); }

.flag-icon-fr { background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTUiIHZpZXdCb3g9IjAgMCAyMCAxNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjIwIiBoZWlnaHQ9IjE1IiBmaWxsPSIjMDAyMzk1Ii8+Cjwvc3ZnPgo='); }

.flag-icon-de { background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTUiIHZpZXdCb3g9IjAgMCAyMCAxNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjIwIiBoZWlnaHQ9IjE1IiBmaWxsPSIjMDAwMDAwIi8+Cjwvc3ZnPgo='); }

/* ========================================
   Global Animations
   ======================================== */

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Fade in up animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide in from left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide in from right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale in animation */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Skeleton loading shimmer */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Pulse animation for loading states */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Animation utility classes */
.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.5s ease-out forwards;
}

.animate-slide-in-left {
  animation: slideInLeft 0.4s ease-out forwards;
}

.animate-slide-in-right {
  animation: slideInRight 0.4s ease-out forwards;
}

.animate-scale-in {
  animation: scaleIn 0.3s ease-out forwards;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Staggered animation delays for lists */
.animate-stagger-1 { animation-delay: 0.05s; }
.animate-stagger-2 { animation-delay: 0.1s; }
.animate-stagger-3 { animation-delay: 0.15s; }
.animate-stagger-4 { animation-delay: 0.2s; }
.animate-stagger-5 { animation-delay: 0.25s; }
.animate-stagger-6 { animation-delay: 0.3s; }
.animate-stagger-7 { animation-delay: 0.35s; }
.animate-stagger-8 { animation-delay: 0.4s; }
.animate-stagger-9 { animation-delay: 0.45s; }
.animate-stagger-10 { animation-delay: 0.5s; }

/* Initial state for staggered animations */
.animate-on-load {
  opacity: 0;
}

/* Skeleton placeholder styles */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--skeleton-base, #e5e7eb) 0%,
    var(--skeleton-highlight, #f3f4f6) 50%,
    var(--skeleton-base, #e5e7eb) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.25rem;
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 0.25rem;
}

.skeleton-text-sm {
  height: 0.75rem;
  margin-bottom: 0.375rem;
}

.skeleton-text-lg {
  height: 1.25rem;
  margin-bottom: 0.625rem;
}

.skeleton-title {
  height: 1.5rem;
  width: 60%;
  margin-bottom: 1rem;
}

.skeleton-paragraph {
  height: 4rem;
  margin-bottom: 0.75rem;
}

.skeleton-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
}

.skeleton-card {
  height: 12rem;
  border-radius: 0.5rem;
}

.skeleton-button {
  height: 2.5rem;
  width: 6rem;
  border-radius: 0.375rem;
}

/* Transition utilities for interactive elements */
.transition-smooth {
  transition: all 0.3s ease;
}

.transition-fast {
  transition: all 0.15s ease;
}

.transition-slow {
  transition: all 0.5s ease;
}

/* Hover lift effect */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Hover scale effect */
.hover-scale {
  transition: transform 0.2s ease;
}

.hover-scale:hover {
  transform: scale(1.02);
}

/* Content reveal animation for Turbo Stream */
.turbo-stream-reveal {
  animation: fadeInUp 0.5s ease-out forwards;
}

/* Description placeholder animation */
.description-placeholder {
  min-height: 4rem;
}

.description-loading {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.description-loading .skeleton-line {
  height: 1rem;
  background: linear-gradient(
    90deg,
    #e5e7eb 0%,
    #f3f4f6 50%,
    #e5e7eb 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.25rem;
}

.description-loading .skeleton-line:nth-child(1) { width: 100%; }
.description-loading .skeleton-line:nth-child(2) { width: 90%; }
.description-loading .skeleton-line:nth-child(3) { width: 75%; }

/* Page transition for Turbo */
.turbo-progress-bar {
  background: var(--primary-color, #1f2937);
}

/* ========================================
   Rouge Syntax Highlighting (GitHub-like theme)
   ======================================== */

/* Code block container */
.highlight {
  background-color: #f6f8fa;
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid #e1e4e8;
}

.highlight pre {
  margin: 0;
  padding: 0;
  background: transparent;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

.highlight code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

/* Inline code */
code {
  background-color: #f6f8fa;
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  font-size: 0.875em;
  color: #24292f;
}

/* Rouge token classes - GitHub theme */
.highlight .c { color: #6a737d; } /* Comment */
.highlight .c1 { color: #6a737d; } /* Comment.Single */
.highlight .cm { color: #6a737d; } /* Comment.Multiline */
.highlight .cp { color: #6a737d; font-weight: bold; } /* Comment.Preproc */
.highlight .cs { color: #6a737d; font-weight: bold; font-style: italic; } /* Comment.Special */

.highlight .err { color: #a61717; background-color: #e3d2d2; } /* Error */

.highlight .k { color: #d73a49; font-weight: bold; } /* Keyword */
.highlight .kc { color: #d73a49; font-weight: bold; } /* Keyword.Constant */
.highlight .kd { color: #d73a49; font-weight: bold; } /* Keyword.Declaration */
.highlight .kn { color: #d73a49; font-weight: bold; } /* Keyword.Namespace */
.highlight .kp { color: #d73a49; } /* Keyword.Pseudo */
.highlight .kr { color: #d73a49; font-weight: bold; } /* Keyword.Reserved */
.highlight .kt { color: #d73a49; font-weight: bold; } /* Keyword.Type */

.highlight .o { color: #d73a49; } /* Operator */
.highlight .ow { color: #d73a49; font-weight: bold; } /* Operator.Word */

.highlight .p { color: #24292f; } /* Punctuation */

.highlight .n { color: #24292f; } /* Name */
.highlight .na { color: #005cc5; } /* Name.Attribute */
.highlight .nb { color: #005cc5; } /* Name.Builtin */
.highlight .nc { color: #6f42c1; font-weight: bold; } /* Name.Class */
.highlight .nd { color: #6f42c1; } /* Name.Decorator */
.highlight .ne { color: #6f42c1; font-weight: bold; } /* Name.Exception */
.highlight .nf { color: #6f42c1; font-weight: bold; } /* Name.Function */
.highlight .ni { color: #800080; } /* Name.Entity */
.highlight .nl { color: #990000; font-weight: bold; } /* Name.Label */
.highlight .nn { color: #555555; } /* Name.Namespace */
.highlight .no { color: #005cc5; } /* Name.Constant */
.highlight .nt { color: #22863a; } /* Name.Tag */
.highlight .nv { color: #e36209; } /* Name.Variable */
.highlight .nx { color: #24292f; } /* Name.Other */

.highlight .s { color: #032f62; } /* String */
.highlight .s1 { color: #032f62; } /* String.Single */
.highlight .s2 { color: #032f62; } /* String.Double */
.highlight .sa { color: #032f62; } /* String.Affix */
.highlight .sb { color: #032f62; } /* String.Backtick */
.highlight .sc { color: #032f62; } /* String.Char */
.highlight .sd { color: #032f62; font-style: italic; } /* String.Doc */
.highlight .se { color: #032f62; } /* String.Escape */
.highlight .sh { color: #032f62; } /* String.Heredoc */
.highlight .si { color: #005cc5; } /* String.Interpol */
.highlight .sr { color: #032f62; } /* String.Regex */
.highlight .ss { color: #005cc5; } /* String.Symbol */
.highlight .sx { color: #032f62; } /* String.Other */

.highlight .m { color: #005cc5; } /* Number */
.highlight .mb { color: #005cc5; } /* Number.Bin */
.highlight .mf { color: #005cc5; } /* Number.Float */
.highlight .mh { color: #005cc5; } /* Number.Hex */
.highlight .mi { color: #005cc5; } /* Number.Integer */
.highlight .mo { color: #005cc5; } /* Number.Oct */
.highlight .mx { color: #005cc5; } /* Number.Other */
.highlight .il { color: #005cc5; } /* Number.Integer.Long */

.highlight .gd { color: #b31d28; background-color: #ffeef0; } /* Generic.Deleted */
.highlight .gi { color: #22863a; background-color: #f0fff4; } /* Generic.Inserted */
.highlight .ge { font-style: italic; } /* Generic.Emph */
.highlight .gs { font-weight: bold; } /* Generic.Strong */
.highlight .gh { color: #005cc5; font-weight: bold; } /* Generic.Heading */
.highlight .gu { color: #6f42c1; font-weight: bold; } /* Generic.Subheading */

.highlight .w { color: #bbbbbb; } /* Text.Whitespace */

/* Line numbers if present */
.highlight .lineno {
  color: #6a737d;
  padding-right: 1rem;
  user-select: none;
}

/* Turbo Stream animations */
@keyframes highlight-fade {
  0% { background-color: rgb(209 250 229); }
  100% { background-color: transparent; }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-highlight {
  animation: highlight-fade 2s ease-out forwards;
}

.animate-fade-in {
  animation: fade-in 0.3s ease-out forwards;
}
