@import url('/designguide/fonts/inter.css');

/* Component Library CSS för Ciklid.org */
/* Tweakad design bättre än Bootstrap med akvariefisk-tema */

:root {
  --primary-blue: #0086BE;
  --apple-gray: #f5f5f7;
  --text-color: #1d1d1f;
  --focus-ring-color: rgba(0, 134, 190, 0.4);
  --focus-ring-width: 4px;
}

/* WCAG 2.1 Focus Styles */
*:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: 1px;
  border-radius: 2px;
}

/* Sticky Sidebar */
.sticky-sidebar {
  position: -webkit-sticky;
  position: sticky;
  top: 80px;
  /* Height of navbar + spacing */
  height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 10px;
}

/* Scrollbar styling for sidebar */
.sticky-sidebar::-webkit-scrollbar {
  width: 6px;
}

.sticky-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sticky-sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

/* Apple Navbar */
.apple-navbar {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 48px;
  display: flex;
  align-items: center;
  font-size: 12px;
}

.apple-navbar-content {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* padding is handled by .container usually, but we might want to keep vertical alignment or reset padding if needed */
}

.apple-navbar-logo img {
  height: 42px;
  width: auto;
}

.apple-navbar-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 24px;
  align-items: center;
}

.apple-navbar-links a {
  color: var(--text-color);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
  font-weight: 400;
}

.apple-navbar-links a:hover {
  opacity: 1;
  color: var(--primary-blue);
}

.apple-navbar-actions .btn {
  font-size: 12px;
  padding: 4px 12px;
}

/* Mobile Actions */
.apple-navbar-mobile-actions .material-icons {
  font-size: 24px;
  opacity: 0.8;
}

/* Overlay Menu */
.apple-menu-overlay,
.apple-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.apple-menu-overlay.active,
.apple-search-overlay.active {
  opacity: 1;
  visibility: visible;
}

.apple-search-content {
  max-width: 680px;
  width: 100%;
  margin: 100px auto 0;
  padding: 0 20px;
}

.apple-search-bar-wrapper {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #d2d2d7;
  padding-bottom: 10px;
}

.apple-search-input {
  border: none;
  background: transparent;
  font-size: 24px;
  font-weight: 600;
  width: 100%;
  margin: 0 15px;
  outline: none;
  color: var(--text-color);
}

.apple-search-input::placeholder {
  color: #86868b;
}

.apple-search-bar-wrapper .material-icons {
  font-size: 24px;
  color: #86868b;
}

/* User Menu & Dropdown */
.apple-user-menu {
  position: relative;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background-color: var(--apple-gray);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-blue);
  font-weight: 600;
  font-size: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.apple-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  min-width: 220px;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.apple-dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 8px 16px;
}

.dropdown-item {
  display: block;
  padding: 8px 16px;
  color: var(--text-color);
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  transition: background-color 0.1s;
}

.dropdown-item:hover {
  background-color: var(--apple-gray);
  color: var(--text-color);
}

.dropdown-item.text-danger:hover {
  background-color: #fff2f2;
  color: #dc3545;
}

.dropdown-divider {
  height: 1px;
  background-color: rgba(0, 0, 0, 0.08);
  margin: 8px 0;
}

.apple-menu-content {
  padding: 20px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.apple-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.apple-menu-links {
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.apple-menu-link {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s;
}

.apple-menu-link:hover {
  color: var(--primary-blue);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .apple-navbar-content {
    padding: 0 16px;
  }

  .apple-navbar-logo img {
    height: 40px;
    /* Reduced by 20% on mobile (was 50px) */
  }
}

/* Apple Footer */
.apple-footer {
  background-color: var(--apple-gray);
  padding: 40px 0;
  font-size: 12px;
  color: #86868b;
  border-top: 1px solid #d2d2d7;
  margin-top: 60px;
  width: 100%;
  /* Ensure full width */
}

.apple-footer-content {
  /* Use container class in HTML instead of custom width here too if possible, or match container */
  /* max-width: 1320px; Match Bootstrap XXL or use container class in footer.php */
  margin: 0 auto;
  padding: 0 20px;
}

.apple-footer h5 {
  font-size: 12px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 9.6px;
}

.apple-footer a {
  color: #424245;
  transition: color 0.2s;
}

.apple-footer a:hover {
  color: var(--primary-blue);
  text-decoration: underline;
}

:root {
  --primary-blue: #0086BE;
  --apple-gray: #f5f5f7;
  --text-color: #1d1d1f;

  /* Akvariefisk-färgpalett - Harmoniserad & Vetenskaplig */
  /* Primary: #0086BE (Ocean Blue) - Clear, trustworthy, WCAG AA compliant */
  --ciklid-primary: #0086BE;
  --ciklid-primary-dark: #006590;
  /* Darker shade for interaction */
  --ciklid-primary-light: #E6F3F9;
  /* Very light tint for backgrounds */

  /* Secondary: Analogous (Teal/Cyan) - Harmonizes with blue */
  --ciklid-secondary: #00A8E8;

  --ciklid-primary-dark: #006590;
  /* Darker shade for hover/active */
  --ciklid-primary-light: #4DB3E0;
  /* Lighter shade */
  --ciklid-secondary: #00A8E8;
  /* Lighter Cyan/Blue - Analogous */
  --ciklid-accent: #FF9F1C;
  /* Warm Orange - Complementary/Contrast */
  --ciklid-background: #F4F8FB;
  /* Subtle cool gray/blue background */
  --ciklid-surface: #FFFFFF;
  /* White surface */
  --ciklid-text: #0F2835;
  /* Deep blue-black for text */
  --ciklid-text-muted: #5A6B75;
  /* Muted blue-gray text */
  --ciklid-border-color: #E1E8ED;
  /* Light border color */

  /* Design-tokens */
  --ciklid-border-radius: 8px;
  /* Slightly softer radius */
  --ciklid-shadow-sm: 0 1px 2px rgba(15, 40, 53, 0.05);
  --ciklid-shadow: 0 4px 12px rgba(15, 40, 53, 0.08);
  --ciklid-shadow-lg: 0 8px 24px rgba(15, 40, 53, 0.12);
  --ciklid-transition: all 0.2s ease-in-out;
  /* Snappier transition */
  --ciklid-font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  font-family: var(--ciklid-font-family);
  color: var(--ciklid-text);
  background-color: var(--ciklid-background);
  line-height: 1.6;
  /* Improved readability */
}

/* Förbättrade buttons - Minimalistisk design */
.btn-primary {
  background-color: var(--ciklid-primary);
  border-color: var(--ciklid-primary);
  border-radius: var(--ciklid-border-radius);
  transition: var(--ciklid-transition);
  box-shadow: none;
  /* Removed shadow for flatness */
  font-weight: 500;
  padding: 0.5rem 1.25rem;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--ciklid-primary-dark);
  border-color: var(--ciklid-primary-dark);
  box-shadow: var(--ciklid-shadow-sm);
  transform: translateY(-1px);
}

.btn-outline-primary {
  border-color: var(--ciklid-primary);
  color: var(--ciklid-primary);
  border-radius: var(--ciklid-border-radius);
  transition: var(--ciklid-transition);
  font-weight: 500;
  background-color: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: rgba(0, 134, 190, 0.05);
  /* Subtle background instead of solid fill */
  color: var(--ciklid-primary-dark);
  border-color: var(--ciklid-primary-dark);
  transform: translateY(-1px);
  box-shadow: none;
}

.btn-secondary {
  background-color: #e9ecef;
  border-color: #e9ecef;
  color: var(--ciklid-text);
  border-radius: var(--ciklid-border-radius);
  transition: var(--ciklid-transition);
  font-weight: 500;
}

.btn-secondary:hover {
  background-color: #dde2e6;
  border-color: #dde2e6;
  color: var(--ciklid-text);
  transform: translateY(-1px);
}

/* Förbättrade alerts */
.alert {
  border-radius: var(--ciklid-border-radius);
  border: 1px solid transparent;
  /* Standard border instead of left-border */
}

.alert-info {
  background-color: rgba(0, 168, 232, 0.1);
  /* Using secondary color */
  border-color: rgba(0, 168, 232, 0.2);
  color: #005c80;
}

.alert-success {
  background-color: rgba(40, 167, 69, 0.1);
  border-color: rgba(40, 167, 69, 0.2);
  color: #1e7e34;
}

.alert-warning {
  background-color: rgba(255, 159, 28, 0.1);
  /* Using accent color */
  border-color: rgba(255, 159, 28, 0.2);
  color: #855300;
}

.alert-danger {
  background-color: rgba(220, 53, 69, 0.1);
  border-color: rgba(220, 53, 69, 0.2);
  color: #a71d2a;
}

/* Förbättrade cards - Minimalistisk & Premium */
.card {
  border-radius: 12px;
  /* Softer corners */
  border: 1px solid rgba(0, 0, 0, 0.08);
  /* Subtle border */
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  /* Smooth Apple-like ease */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  /* Very subtle base shadow */
  background-color: var(--ciklid-surface);
}

.card:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  /* Deep, soft shadow on hover */
  transform: translateY(-2px);
  border-color: rgba(0, 134, 190, 0.3);
}

.card-header {
  background-color: transparent;
  /* Cleaner look */
  border-bottom: 1px solid var(--ciklid-border-color);
  padding: 1.25rem 1.5rem;
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

/* Förbättrade inputs - Modern & Accessible */
.form-control {
  border-radius: var(--ciklid-border-radius);
  border: 1px solid #ced4da;
  /* Standard border for good contrast */
  transition: var(--ciklid-transition);
  padding: 0.75rem 1rem;
  background-color: var(--ciklid-surface);
  color: var(--ciklid-text);
}

.form-control:focus {
  border-color: var(--ciklid-primary);
  box-shadow: 0 0 0 3px rgba(0, 134, 190, 0.15);
  /* Accessible focus ring */
  outline: none;
}

/* Floating labels - Moderniserad & Fixad */
.ciklid-floating-label {
  position: relative;
  margin-bottom: 1.5rem;
}

.ciklid-floating-label input,
.ciklid-floating-label textarea,
.ciklid-floating-label select {
  padding: 1.25rem 1rem 0.5rem 1rem;
  /* Mer plats nertill för texten, mer upptill för label */
  border: 1px solid #ced4da;
  border-radius: var(--ciklid-border-radius);
  transition: var(--ciklid-transition);
  background-color: var(--ciklid-surface);
  width: 100%;
  height: 3.5rem;
  /* Fast höjd */
  font-size: 1rem;
  color: var(--ciklid-text);
  line-height: 1.5;
}

.ciklid-floating-label textarea {
  height: auto;
  min-height: 120px;
  padding-top: 1.75rem;
  /* Mer plats för label i textarea */
}

.ciklid-floating-label label {
  position: absolute;
  top: 1rem;
  left: 1rem;
  color: var(--ciklid-text-muted);
  font-size: 1rem;
  pointer-events: none;
  transition: var(--ciklid-transition);
  background-color: transparent;
  padding: 0;
  margin: 0;
  transform-origin: 0 0;
  opacity: 0.7;
}

.ciklid-floating-label input:focus,
.ciklid-floating-label textarea:focus,
.ciklid-floating-label select:focus {
  border-color: var(--ciklid-primary);
  box-shadow: 0 0 0 3px rgba(0, 134, 190, 0.15);
}

/* Active state for floating label (focus or has value) */
.ciklid-floating-label input:focus~label,
.ciklid-floating-label textarea:focus~label,
.ciklid-floating-label select:focus~label,
.ciklid-floating-label input:not(:placeholder-shown)~label,
.ciklid-floating-label textarea:not(:placeholder-shown)~label,
.ciklid-floating-label select:not([value=""])~label {
  transform: translateY(-0.65rem) scale(0.85);
  /* Lite större skala (var 0.85) */
  color: var(--ciklid-primary);
  font-weight: 600;
  /* Tydligare vikt */
  opacity: 1;
}

/* Specifik fix för Select - se till att label inte krockar med pilen eller texten */
.ciklid-floating-label select {
  padding-top: 1.25rem;
  padding-bottom: 0.25rem;
}

/* Fixa hoppande siffror i range slider labels */
.form-label .badge,
.form-label .badge.bg-primary {
  display: inline-block;
  width: 4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-sizing: border-box;
  font-feature-settings: "tnum";

  /* Fixad design enligt önskemål: Blå bakgrund, Vit text */
  background-color: var(--ciklid-primary) !important;
  /* Tvinga blå bakgrund */
  color: #FFFFFF !important;
  /* Tvinga vit text för kontrast */
  border: none !important;
  /* Ingen border behövs med fylld bakgrund */
  border-radius: 4px;
  padding: 0.35em 0.65em;
  font-weight: 600;
  box-shadow: var(--ciklid-shadow-sm);
}

/* Komponent-specifika klasser - Minimalistisk */
.ciklid-card-enhanced {
  border-radius: var(--ciklid-border-radius);
  box-shadow: var(--ciklid-shadow-sm);
  transition: var(--ciklid-transition);
  overflow: hidden;
  border: 1px solid var(--ciklid-border-color);
  background-color: var(--ciklid-surface);
}

.ciklid-card-enhanced:hover {
  box-shadow: var(--ciklid-shadow);
  transform: translateY(-3px);
  border-color: rgba(0, 134, 190, 0.2);
}

/* Removed gradient button class in favor of flat design */
.ciklid-button-gradient {
  background-color: var(--ciklid-primary);
  border: none;
  color: white;
  border-radius: var(--ciklid-border-radius);
  transition: var(--ciklid-transition);
  padding: 0.5rem 1.25rem;
  font-weight: 500;
}

.ciklid-button-gradient:hover {
  background-color: var(--ciklid-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--ciklid-shadow-sm);
}

/* Utility-klasser för designguide */
.component-demo {
  padding: 1.5rem;
  border: 1px solid rgba(0, 134, 190, 0.1);
  border-radius: var(--ciklid-border-radius);
  background-color: white;
  margin-bottom: 1.5rem;
}

.code-block {
  position: relative;
  background-color: #f8f9fa;
  border: 1px solid rgba(0, 134, 190, 0.1);
  border-radius: var(--ciklid-border-radius);
  padding: 1rem;
  margin-top: 1rem;
}

.code-block pre {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ciklid-text);
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  background-color: var(--ciklid-primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--ciklid-transition);
}

.copy-btn:hover {
  background-color: var(--ciklid-primary-dark);
}

.copy-btn.copied {
  background-color: #28a745;
}

/* Förbättrade Art Cards */
.art-card-hover {
  border-radius: var(--ciklid-border-radius);
  overflow: hidden;
  transition: var(--ciklid-transition);
  box-shadow: var(--ciklid-shadow);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.art-card-hover:hover {
  transform: translateY(-6px);
  box-shadow: var(--ciklid-shadow-lg);
}

.art-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  /* 4:3 format - högre bildyta än 16:9 */
  overflow: hidden;
  background-color: #000;
  background: linear-gradient(135deg, rgba(0, 134, 190, 0.05) 0%, rgba(0, 180, 216, 0.05) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.art-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Visa hela bilden - ingen klippning på sidorna */
  object-position: center center;
  /* Centrera bilden vertikalt */
  transition: transform 0.4s ease, opacity 0.3s ease;
  z-index: 0;
}

.art-card-hover:hover .art-image-wrapper img {
  transform: scale(1.08);
}

.art-image-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.05) 100%);
  opacity: 0;
  transition: var(--ciklid-transition);
  pointer-events: none;
}

.art-card-hover:hover .art-image-wrapper::after {
  opacity: 1;
}

.art-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
  background-color: white;
}

.art-card-body .card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.art-card-body .card-title a {
  color: var(--ciklid-text);
  transition: var(--ciklid-transition);
}

.art-card-body .card-title a:hover {
  color: var(--ciklid-primary);
}

.art-card-body .card-subtitle {
  font-size: 0.875rem;
  margin-bottom: 1rem;
  min-height: 1.5rem;
}

.art-button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.art-button-group .btn {
  border-radius: var(--ciklid-border-radius);
  transition: var(--ciklid-transition);
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
}

.art-button-group .btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--ciklid-shadow-sm);
}

.art-icons {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(0, 134, 190, 0.12);
}

.art-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-align: center;
}

.art-icon img {
  width: 24px;
  height: 24px;
  opacity: 0.8;
  transition: var(--ciklid-transition);
}

.art-card-hover:hover .art-icon img {
  opacity: 1;
  transform: scale(1.1);
}

.apple-submenu .apple-menu-link {
  font-size: 0.9rem;
  padding: 8px 0;
  color: var(--ciklid-text-muted);
  font-weight: 400;
  display: block;
  /* Ensure each link is on a new line */
}

.art-icon small {
  font-size: 0.7rem;
  line-height: 1.2;
  color: var(--ciklid-text-muted);
}

.art-photo-credit {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 0.4rem 0.75rem;
  font-size: 0.6rem;
  text-align: center;
  z-index: 2;
  font-weight: 500;
  backdrop-filter: blur(4px);
  opacity: 1;
  transition: var(--ciklid-transition);
}

.art-card-hover:hover .art-photo-credit {
  background: rgba(0, 0, 0, 0.6);
}

/* Responsiv design för art cards */
@media (max-width: 768px) {
  .art-image-wrapper {
    aspect-ratio: 4/3;
    /* 4:3 format på mobil också */
  }

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

  .art-card-hover:hover {
    transform: translateY(-3px);
  }
}

/* Desktop-specifik förbättring för art cards */
@media (min-width: 992px) {
  .art-card-hover {
    box-shadow: var(--ciklid-shadow);
  }

  .art-card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 134, 190, 0.2);
  }

  .art-image-wrapper {
    aspect-ratio: 4/3;
    /* 4:3 format på desktop */
  }

  .art-image-wrapper:hover img {
    transform: scale(1.05);
    /* Lite zoom vid hover */
  }
}

/* Typography-förbättringar */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--ciklid-text);
  font-weight: 600;
}

.text-primary {
  color: var(--ciklid-primary) !important;
}

/* Spacing-förbättringar */
.section-spacing {
  margin-bottom: 3rem;
}

@media (min-width: 992px) {
  .section-spacing {
    margin-bottom: 4rem;
  }
}