/* ============================================
   CSS RESET & BASE STYLES
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #333333;
  line-height: 1.6;
  background-color: #f5f5f5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #2ed447;
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  color: #1fb333;
  text-decoration: underline;
  font-weight: 600;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */

.main-content {
  width: 100%;
  margin: 0;
  padding: 0;
}

.container {
  display: flex;
  justify-content: center;
}

@media (min-width: 768px) {
  .main-content {
    max-width: 1200px;
    padding: 4rem 1rem;
    margin: 0 auto;
  }
}

/* ============================================
   Button styles
   ============================================ */

.btn {
  display: inline-block;
  cursor: pointer;
  background: white;
  color: #2ed447;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.btn:hover {
  background: #f0f0f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
  font-weight: 700;
  text-decoration: none;
}

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

.btn-green {
  background: linear-gradient(135deg, #42f55d 0%, #2ed447 100%);
  color: white;
}

.btn-green:hover {
  background: linear-gradient(135deg, #2ed447 0%, #1fb333 100%);
  color: white;
}

.btn-orange {
  background: linear-gradient(135deg, #f5c542 0%, #d4ad2e 100%);
  color: white;
}

.btn-orange:hover {
  background: linear-gradient(135deg, #d4ad2e 0%, #b3731f 100%);
  color: white;
}

.btn-red {
  background: linear-gradient(135deg, #f54242 0%, #d42e2e 100%);
  color: white;
}

.btn-red:hover {
  background: linear-gradient(135deg, #d42e2e 0%, #b31f1f 100%);
  color: white;
}

.btn-action {
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.65rem;
  width: 100%;
}

.user-menu .btn {
  display: flex;
  height: 2.5rem;
  align-items: center;
}

.btn-icon {
  font-size: 1rem;
}

@media (min-width: 768px) {
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
  }

  .btn-action {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
  }

  .user-menu .btn {
    height: 3rem;
  }

  .btn-icon {
    font-size: 1.5rem;
  }
}

/* ============================================
   HEADER SECTION
   ============================================ */

.site-header {
  background: linear-gradient(135deg, #42f55d 0%, #2ed447 100%);
  color: white;
  padding: 2rem 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content {
  display: flex;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.site-title a:hover,
.site-title a:visited:hover {
  color: inherit;
}

.site-title img {
  width: 120px;
  height: 75px;
  vertical-align: bottom;
}

/* User menu in header */
.user-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .site-title img {
    width: 235px;
    height: 150px;
  }
}

/* ============================================
   COMPETITION CARD
   ============================================ */

/* Card Header */
.competition-card-header {
  background: linear-gradient(135deg, #c8fcba 0%, #9bf99a 100%);
  color: #0f9322;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 3px solid #42f55d;
}

.competition-name {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.competition-name p {
  font-size: 1rem;
  text-transform: uppercase;
}

.competition-name h3 {
  font-size: 1.5rem;
  font-weight: 700;
}

.competition-card-info {
  padding: 0;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background-color: #e0e0e0;
  color: #666666;
  border: 2px solid #cccccc;
}

.competition-description {
  color: #666666;
  margin-bottom: 2rem;
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: break-word;
}

.competition-description * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.competition-description > *:first-child {
  margin-top: 0;
}

.competition-description h1 {
  font-size: 1.6em;
  margin-bottom: 0.8em;
}

.competition-description h2 {
  font-size: 1.4em;
  margin-top: 1.6em;
  margin-bottom: 0.8em;
}

.competition-description h3 {
  font-size: 1.2em;
  margin-top: 1.5em;
  margin-bottom: 0.6em;
}

.competition-description h4 {
  margin-top: 1.4em;
  margin-bottom: 0.4em;
}

.competition-description blockquote {
  margin-top: 1.33333em;
  margin-bottom: 1.33333em;
  padding-inline-start: 1.11111em;
  border: 0 solid #ccc;
  border-left-width: 0.3em;
}

.competition-description [dir="rtl"] blockquote,
.competition-description blockquote[dir="rtl"] {
  border-width: 0;
  border-right-width: 0.3em;
  margin-right: 0.3em;
  padding-right: 0.6em;
}

.competition-description ul,
.competition-description ol {
  padding-inline-start: 1.7em;
}

.competition-description li {
  padding-inline-start: 0.4em;
}

.competition-description [dir="rtl"] li {
  margin-right: 1em;
}

.competition-description pre {
  width: 100%;
  vertical-align: top;
  font-family: monospace;
  font-size: 0.9em;
  padding-top: 0.666667em;
  padding-inline-end: 1em;
  padding-bottom: 0.666667em;
  border-radius: 6px;
  margin-top: 1.66667em;
  margin-bottom: 1.66667em;
  padding-inline-start: 1em;
  font-size: 0.857143em;
  line-height: 1.66667;
  white-space: pre;
  background-color: #eee;
  overflow-x: auto;
}

.competition-description img {
  max-width: 100%;
  height: auto;
}

.competition-description .attachment {
  display: inline-block;
  position: relative;
  max-width: 100%;
}

.competition-description .attachment a {
  color: inherit;
  text-decoration: none;
}

.competition-description .attachment a:hover,
.competition-description .attachment a:visited:hover {
  color: inherit;
}

.competition-description .attachment__caption {
  text-align: center;
}

.competition-description
  .attachment__caption
  .attachment__name
  + .attachment__size::before {
  content: " \2022 ";
}

.competition-description .attachment--preview {
  width: 100%;
  text-align: center;
}

.competition-description .attachment--preview .attachment__caption {
  color: #666;
  font-size: 0.9em;
  line-height: 1.2;
}

.competition-description .attachment--file {
  color: #333;
  line-height: 1;
  margin: 0 2px 2px 2px;
  padding: 0.4em 1em;
  border: 1px solid #bbb;
  border-radius: 5px;
}

.competition-description .attachment-gallery {
  display: flex;
  flex-wrap: wrap;
  position: relative;
}

.competition-description .attachment-gallery .attachment {
  flex: 1 0 33%;
  padding: 0 0.5em;
  max-width: 33%;
}

.competition-description .attachment-gallery.attachment-gallery--2 .attachment,
.competition-description .attachment-gallery.attachment-gallery--4 .attachment {
  flex-basis: 50%;
  max-width: 50%;
}

/* Dates Grid */
.dates-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.date-item {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 1rem;
  background-color: #f5f5f5;
  border-left: 4px solid #e0e0e0;
}

.date-item:hover {
  background-color: #c8fcba;
  border-left-color: #42f55d;
}

.date-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.date-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.date-label {
  font-size: 0.875rem;
  color: #666666;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.date-value {
  font-size: 1.125rem;
  color: #333333;
  font-weight: 600;
}

.user-inscriptions {
  background-color: rgba(66, 245, 93, 0.1);
  border-left: 4px solid #42f55d;
  padding: 1rem;
}

.user-inscriptions:hover {
  background-color: rgba(66, 245, 93, 0.2);
}

.user-inscriptions-pending {
  background-color: rgba(230, 245, 66, 0.1);
  border-left: 4px solid #f5ec42;
}

.user-inscriptions-pending:hover {
  background-color: rgba(230, 245, 66, 0.2);
}

.user-inscriptions-problem {
  background-color: rgba(245, 66, 66, 0.1);
  border-left: 4px solid #f54242;
}

.user-inscriptions-problem:hover {
  background-color: rgba(245, 66, 66, 0.2);
}

.user-inscriptions ul {
  padding-left: 1rem;
}

@media (min-width: 768px) {
  .competition-name {
    align-items: start;
  }

  .competition-name p {
    font-size: 1.25rem;
  }

  .competition-name h3 {
    font-size: 2.25rem;
  }

  .competition-card-info {
    padding: 2.5rem;
    padding-bottom: 0;
  }

  .user-inscriptions {
    border-radius: 8px;
    transition: all 0.3s ease;
    padding: 1rem;
    margin-bottom: 0.5rem;
  }

  .user-inscriptions:hover {
    transform: translateX(5px);
  }

  .user-inscriptions:last-child {
    margin-bottom: 1.5rem;
  }

  .user-inscriptions ul {
    padding-left: 1rem;
  }

  .competition-description {
    font-size: 1.25rem;
  }

  .dates-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .date-item {
    gap: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
  }

  .date-item:hover {
    transform: translateX(5px);
  }

  .date-label {
    font-size: 1rem;
  }

  .date-value {
    font-size: 1.25rem;
  }
}

/* ============================================
   EMPTY STATE (No Competition)
   ============================================ */

.empty-state {
  background: white;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  padding: 4rem 2rem;
  text-align: center;
  width: 100%;
  margin: 0 auto;
}

.empty-state-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  opacity: 0.7;
}

.empty-state-title {
  font-size: 1.75rem;
  color: #0f9322;
  margin-bottom: 1rem;
  font-weight: 600;
}

.empty-state-message {
  font-size: 1.125rem;
  color: #666666;
  margin-bottom: 0.5rem;
  line-height: 1.8;
}

@media (min-width: 768px) {
  .empty-state {
    border-radius: 12px;
    padding: 5rem 3rem;
    max-width: 800px;
  }

  .empty-state-icon {
    font-size: 6rem;
  }

  .empty-state-title {
    font-size: 2rem;
  }
}

/* ============================================
   CARD FORM
   ============================================ */

.card {
  background: white;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  width: 100%;
}

.card-header {
  background: linear-gradient(135deg, #c8fcba 0%, #9bf99a 100%);
  color: #0f9322;
  border-bottom: 3px solid #42f55d;
  padding: 1rem 2rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.card-icon {
  font-size: 2rem;
  margin-top: 0.5rem;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.card-subtitle {
  flex-basis: 100%;
  text-align: center;
  font-size: 0.95rem;
}

.card-body {
  padding: 2rem;
}

.card-body-msg {
  text-align: center;
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .card {
    width: auto;
    min-width: 425px;
    margin-bottom: 3rem;
    border-radius: 12px;
  }

  .card-header {
    padding: 2.5rem;
    flex-direction: column;
  }

  .competition-card-header {
    padding: 2.5rem;
    flex-direction: row;
    gap: 4rem;
  }

  .card-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
  }

  .card-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }

  .card-body {
    padding: 2.5rem;
  }
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #333333;
  margin-bottom: 0.5rem;
}

.form-group input,
.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-group input:focus,
.form-input:focus {
  outline: none;
  border-color: #42f55d;
  box-shadow: 0 0 0 3px rgba(66, 245, 93, 0.1);
}

.form-error {
  background-color: #ffe0e0;
  color: #cc0000;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border-left: 4px solid #cc0000;
  font-size: 0.95rem;
}

.form-error ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.form-error li {
  margin-bottom: 0.25rem;
}

.btn-submit {
  width: 100%;
  padding: 1rem;
  font-size: 1.125rem;
  background: linear-gradient(135deg, #42f55d 0%, #2ed447 100%);
  color: white;
}

.btn-submit:hover {
  background: linear-gradient(135deg, #2ed447 0%, #1fb333 100%);
  color: white;
}

.card-footer {
  padding: 1.5rem 2.5rem;
  background-color: #f5f5f5;
  text-align: center;
  font-size: 0.95rem;
  color: #666666;
}

/* Password Requirements */
.password-requirements {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0 0;
  font-size: 0.875rem;
  color: #666666;
  background-color: #f9f9f9;
  border-radius: 8px;
  padding: 1rem;
  border-left: 3px solid #42f55d;
}

.password-requirements li {
  padding: 0.25rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.password-requirements li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #42f55d;
  font-weight: bold;
}

/* Password visibility toggle */
.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.25rem;
  color: #666666;
  line-height: 1;
}

.password-toggle:hover {
  color: #333333;
}

/* Help Text */
.form-help-text {
  font-size: 0.875rem;
  color: #666666;
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* Checkbox Styling */
.form-group-checkbox {
  margin-bottom: 2rem;
}

.form-label-checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #333333;
  cursor: pointer;
}

input.form-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
  accent-color: #42f55d;
}

.checkbox-label-text {
  user-select: none;
}

.form-error p {
  margin: 0;
  padding: 0.25rem 0;
}

.form-info {
  background-color: rgba(66, 245, 93, 0.1);
  color: #0f9322;
  padding: 1rem;
  font-size: 0.95rem;
}

.form-info p {
  max-width: 512px;
}

.form-info ul {
  padding-left: 1rem;
  margin-bottom: 0.25rem;
}

.form-warn {
  background-color: rgba(230, 245, 66, 0.2);
  padding: 1rem;
  font-size: 0.95rem;
}

.form-warn ul {
  padding-left: 1rem;
  margin-bottom: 0.25rem;
}

/* ============================================
   PROFILE PAGE
   ============================================ */

/* Make user-info clickable */
.user-info {
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.user-info:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* ============================================
   USER DROPDOWN MENU
   ============================================ */

.user-dropdown {
  position: relative;
}

/* Remove native <details> triangle marker */
.user-dropdown > summary {
  list-style: none;
}
.user-dropdown > summary::-webkit-details-marker {
  display: none;
}

.user-dropdown__toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
}

.user-dropdown__arrow {
  transition: transform 0.2s ease;
  line-height: 1;
}

.user-dropdown[open] .user-dropdown__arrow {
  transform: rotate(180deg);
}

.user-dropdown__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  min-width: 160px;
  overflow: hidden;
  z-index: 100;
}

.user-dropdown__item,
.user-dropdown__menu a {
  display: block;
  width: 100%;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  color: #333333;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.2s ease;
  box-sizing: border-box;
}

.user-dropdown__item:hover,
.user-dropdown__menu a:hover {
  background-color: #f0f0f0;
  color: #2ed447;
}

.user-dropdown__item:last-child {
  border-top: 1px solid #e0e0e0;
}

/* Success message */
.success-message {
  background-color: #d4edda;
  color: #155724;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border-left: 4px solid #42f55d;
  font-size: 0.95rem;
  font-weight: 600;
}

/* Profile sections */
.profile-info-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid #e0e0e0;
}

.profile-form-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid #e0e0e0;
}

.profile-section-title {
  font-size: 1.25rem;
  color: #0f9322;
  font-weight: 700;
  margin-bottom: 1.5rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #e0e0e0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-section-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.dog-name {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  color: #333333;
  padding-bottom: 0;
  margin-bottom: 0.5rem;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  background-color: #333333;
  color: white;
  padding: 2rem 0;
  margin-top: auto;
}

.footer-text {
  text-align: center;
  font-size: 0.875rem;
  opacity: 0.8;
}

/* ============================================
   ACCESSIBILITY & PRINT STYLES
   ============================================ */

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
.btn:focus,
.form-input:focus {
  outline: 3px solid #42f55d;
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print styles */
@media print {
  .site-header,
  .site-footer,
  .btn,
  .user-menu {
    display: none;
  }

  .card {
    box-shadow: none;
    border: 1px solid #333;
  }

  body {
    background: white;
  }
}

/* ============================================
   PROFILE — DOGS SECTION
   ============================================ */

/* Call to Action */
.cta-section {
  text-align: center;
  margin-top: 2rem;
}

/* Dog list container */
.dog-list {
  display: grid;
  gap: 1rem;
}

/* Individual dog card (owned and borrowed share this) */
.dog-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem;
  background-color: #f9f9f9;
}

/* Card inner row: info left, actions right */
.dog-card__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* Dog info column (fills remaining space) */
.dog-card__info {
  flex: 1;
}

/* Dog attribute Single-column variant (Altura+Clase share one row manually) */
.dog-attrs {
  display: flex;
  flex-direction: column;
  font-size: 0.875rem;
}

/* Action buttons column (right side of card) */
.dog-card__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-left: 1rem;
}

/* Zero-margin form wrapper for action forms */
.form-inline {
  margin: 0;
}

/* Share panel (hidden until JS shows it) — commented-out block */
.dog-share-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
}

.dog-share-panel p {
  padding: 0.25rem;
}

/* Share form row (email input + submit side by side) */
.dog-share-form {
  display: flex;
  gap: 0.5rem;
}

/* Empty state paragraph when no dogs are registered */
.dog-empty-state {
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 2rem 0;
}

/* ============================================
   PROFILE — TWO-COLUMN LAYOUT (TABLET+)
   ============================================ */

.profile-columns {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  /* Widen the card to fit two columns */
  .profile-card {
    max-width: 900px;
  }

  .profile-columns {
    grid-template-columns: 1fr 1fr;
    gap: 0 2rem;
    align-items: start;
  }

  /* Replace stacked border-bottom separators with a vertical divider */
  .profile-columns .profile-form-section,
  .profile-columns .profile-info-section {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }

  .profile-columns .profile-form-section {
    border-right: 2px solid #e0e0e0;
    padding-right: 2rem;
  }
}
