/**
 * TankFacts Aquariums - Frontend Styles
 * My Tank hub, registration form, and shared UI components.
 */

/* Mobile-first: base = small screens */
.tf-my-tank-hub { --tf-radius: 12px; --tf-radius-lg: 16px; --tf-space: 16px; --tf-space-lg: 24px; --tf-border: 1px solid #e5e7eb; --tf-muted: #6b7280; --tf-focus: 2px solid #0ea5e9; }
.tf-my-tank-hub { max-width: 100%; padding: var(--tf-space); box-sizing: border-box; }
.tf-hub-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 var(--tf-space-lg) 0; line-height: 1.2; }
.tf-hub-nav { display: flex; gap: 0; border-bottom: var(--tf-border); margin-bottom: var(--tf-space-lg); }
.tf-hub-nav-link { flex: 1; text-align: center; padding: 14px 12px; font-size: 0.9375rem; font-weight: 600; color: var(--tf-muted); text-decoration: none; border-bottom: 3px solid transparent; transition: color 0.15s, border-color 0.15s; min-height: 48px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; }
.tf-hub-nav-link:hover, .tf-hub-nav-link:focus { color: #111827; outline: none; }
.tf-hub-nav-link.tf-hub-nav-link-active { color: #111827; border-bottom-color: #0ea5e9; }
.tf-panel { display: block; }
.tf-panel[hidden] { display: none !important; }
.tf-card { background: #fff; border: var(--tf-border); border-radius: var(--tf-radius-lg); padding: var(--tf-space-lg); margin-bottom: var(--tf-space); }
.tf-card-title { font-size: 1.125rem; font-weight: 600; margin: 0 0 8px 0; }
.tf-muted { color: var(--tf-muted); font-size: 0.875rem; margin: 0 0 10px 0; }
.tf-muted:last-child { margin-bottom: 0; }
.tf-small { font-size: 0.8125rem; }
.tf-label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 6px; }
.tf-input, .tf-select { width: 100%; max-width: 100%; padding: 12px 14px; font-size: 1rem; border: var(--tf-border); border-radius: var(--tf-radius); box-sizing: border-box; margin-bottom: 10px; }
.tf-input:focus, .tf-select:focus { outline: none; border-color: #0ea5e9; box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2); }
.tf-btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 20px; font-size: 1rem; font-weight: 600; border-radius: var(--tf-radius); border: none; cursor: pointer; min-height: 48px; min-width: 48px; box-sizing: border-box; }
.tf-btn-primary { background: #0ea5e9; color: #fff; }
.tf-btn-primary:hover { background: #0284c7; }
.tf-btn-primary:focus { outline: none; box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.4); }
.tf-username-form .tf-username-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 6px; }
.tf-username-form .tf-username-row .tf-input { flex: 1 1 180px; margin-bottom: 0; min-width: 0; }
.tf-username-form .tf-username-row .tf-btn { flex-shrink: 0; }
.tf-hint { font-size: 0.8125rem; color: var(--tf-muted); margin: 0 0 8px 0; }
.tf-username-availability { font-size: 0.875rem; display: block; margin-top: 4px; }
.tf-username-availability.success { color: #15803d; }
.tf-username-availability.error { color: #b91c1c; }
.tf-msg { font-size: 0.875rem; display: block; }
.tf-msg.error { color: #b91c1c; }
.tf-msg.success { color: #15803d; }
.tf-username-gate { border-left: 4px solid #0ea5e9; }
.tf-tanks-disabled { background: #f9fafb; }
.tf-hub-intro { margin-bottom: var(--tf-space); }
.tf-add-tank-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.tf-add-tank-row .tf-input { flex: 1 1 180px; margin-bottom: 0; min-width: 0; }
.tf-add-tank-row .tf-select { width: auto; flex: 0 1 140px; margin-bottom: 0; }
.tf-add-tank-row .tf-btn { flex-shrink: 0; }
.tf-empty-state { background: #f9fafb; }
.tf-username-readonly { font-size: 1.125rem; margin: 0 0 6px 0; }
.tf-contact-dl { margin: 0; }
.tf-contact-dl dt { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; color: var(--tf-muted); margin-top: 12px; }
.tf-contact-dl dt:first-child { margin-top: 0; }
.tf-contact-dl dd { margin: 4px 0 0 0; font-size: 0.9375rem; }
.tf-aquarium-list { list-style: none; padding: 0; margin: 0; }
.tf-aquarium-item { border: var(--tf-border); border-radius: var(--tf-radius-lg); padding: var(--tf-space); margin-bottom: var(--tf-space); background: #fff; }
.tf-aquarium-header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
.tf-aquarium-name-edit { font-size: 1.125rem; font-weight: 600; padding: 10px 12px; border: var(--tf-border); border-radius: var(--tf-radius); max-width: 100%; flex: 1 1 200px; min-width: 0; box-sizing: border-box; }
.tf-aquarium-name-edit:focus { outline: none; border-color: #0ea5e9; }
.tf-badge { display: inline-flex; align-items: center; padding: 6px 12px; font-size: 0.8125rem; font-weight: 500; border: var(--tf-border); border-radius: 999px; background: #f9fafb; color: #374151; text-decoration: none; }
.tf-badge:hover { background: #f3f4f6; }
.tf-my-tank-hub .tf-delete-aquarium { margin-left: auto; font-size: 0.875rem; padding: 8px 14px; min-height: 44px; background: #fff; border: var(--tf-border); color: #b91c1c; }
.tf-my-tank-hub .tf-delete-aquarium:hover { background: #fef2f2; }
.tf-aquarium-item .tf-muted { font-size: 0.8125rem; margin: 6px 0 10px 0; }
.tf-tank-image-wrap { margin-bottom: 12px; }
.tf-aquarium-hero, .tf-aquarium-hero-placeholder { width: 100%; max-width: 320px; aspect-ratio: 16/10; border-radius: var(--tf-radius); overflow: hidden; background: #f3f4f6; margin-bottom: 8px; }
.tf-tank-image-wrap .tf-aquarium-hero-img { max-width: 100%; width: auto; height: auto; border-radius: var(--tf-radius); display: block; margin-bottom: 8px; }
.tf-aquarium-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tf-tank-image-btn { font-size: 0.875rem; padding: 8px 14px; min-height: 44px; margin-top: 4px; }
.tf-aquarium-item h3 { font-size: 0.9375rem; font-weight: 600; margin: 10px 0 6px 0; }
.tf-species-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-top: 10px; }
.tf-species-card { position: relative; border: var(--tf-border); border-radius: var(--tf-radius); overflow: hidden; background: #fff; }
.tf-species-card a { display: block; text-decoration: none; color: inherit; }
.tf-species-card .tf-species-thumb { aspect-ratio: 1; background: #f3f4f6; overflow: hidden; }
.tf-species-card .tf-species-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tf-species-card .tf-species-name { padding: 8px; font-size: 0.8125rem; font-weight: 600; line-height: 1.2; }
.tf-remove-species { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(0,0,0,0.6); color: #fff; cursor: pointer; font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0; z-index: 1; }
.tf-remove-species:hover { background: #b91c1c; }

@media (min-width: 640px) {
    .tf-my-tank-hub { max-width: 640px; margin: 0 auto; padding: var(--tf-space-lg); }
    .tf-hub-title { font-size: 1.75rem; }
    .tf-add-tank-row .tf-input { flex: 1 1 220px; }
}

@media (min-width: 900px) {
    .tf-my-tank-hub { max-width: 900px; }
}

/* Registration form */
.tf-register-form .tf-register-errors { margin: 0 0 12px 0; padding-left: 1.2em; color: #b91c1c; }
.tf-register-form .tf-field { margin-bottom: 16px; }
.tf-register-form .tf-submit { margin-top: 20px; margin-bottom: 0; }
.tf-register-form .tf-optional { font-weight: normal; color: #6b7280; }
.tf-register-form .tf-username-availability.success { color: #15803d; }
.tf-register-form .tf-username-availability.error { color: #b91c1c; }
