/* Styles for custom features: Auth, User Cabinet, and Dark Theme Switcher */

.custom-phone-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: #ffffff;
  background-color: transparent;
  text-decoration: none;
}

html:not(.sgi-dark-theme) .sgi-header .custom-phone-contact {
  color: #2c254b;
}

html.sgi-dark-theme .sgi-header .custom-phone-contact {
  color: #ffffff;
}

.custom-phone-contact svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.custom-auth-container {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background-color: #101426; /* Dark blue background from the photo */
  padding: 8px 12px;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  vertical-align: middle;
}

.custom-btn-accedi {
  background-color: #ff3377; /* Accent pink color from the photo */
  color: #ffffff;
  border: none;
  font-family: var(--sgi-font-display), sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
}

.custom-btn-accedi:hover {
  background-color: #ff1a66;
}

.custom-btn-registrati {
  background-color: transparent;
  color: #ffffff;
  border: 2px solid #ffffff;
  font-family: var(--sgi-font-display), sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  padding: 6px 14px; /* Adjusted padding to compensate for 2px border */
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.custom-btn-registrati:hover {
  background-color: #ffffff;
  color: #101426;
}

/* User Cabinet Modal Styles */
.custom-cabinet-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(16, 20, 38, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1.5rem;
}

.custom-cabinet-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

.custom-cabinet-card {
  background-color: var(--sgi-paper);
  color: var(--sgi-text);
  border: 2px solid var(--sgi-ink);
  border-radius: var(--sgi-radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  transform: translateY(20px);
  transition: transform 0.3s ease;
  padding: 2rem;
  position: relative;
}

.custom-cabinet-overlay.is-active .custom-cabinet-card {
  transform: translateY(0);
}

.custom-cabinet-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: transparent;
  border: 1px solid var(--sgi-line);
  color: var(--sgi-ink);
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--sgi-radius);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  z-index: 10;
}

.custom-cabinet-close:hover {
  background-color: var(--sgi-ink);
  color: var(--sgi-paper);
}

/* Modal Tabs */
.custom-cabinet-tabs {
  display: flex;
  border-bottom: 2px solid var(--sgi-line);
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.custom-cabinet-tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.5rem 1rem;
  font-family: var(--sgi-font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--sgi-muted);
  cursor: pointer;
  margin-bottom: -2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.custom-cabinet-tab.is-active {
  color: var(--sgi-ink);
  border-bottom-color: var(--sgi-coral);
}

/* Profile Details UI */
.custom-profile-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.custom-profile-avatar-container {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--sgi-coral);
  background-color: var(--sgi-line);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.custom-profile-avatar-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.custom-profile-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.custom-profile-info-row {
  border-bottom: 1px solid var(--sgi-line);
  padding-bottom: 0.5rem;
}

.custom-profile-info-label {
  font-family: var(--sgi-font-display);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sgi-muted);
}

.custom-profile-info-val {
  font-weight: 600;
  font-size: 1rem;
  color: var(--sgi-ink);
  margin-top: 0.2rem;
  word-break: break-word;
}

/* Avatar upload area styling */
.custom-avatar-upload-wrapper {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1rem;
}

.custom-avatar-preview-box {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px dashed var(--sgi-line);
  background-color: rgba(0,0,0,0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.custom-avatar-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.custom-avatar-preview-box span {
  font-size: 0.65rem;
  color: var(--sgi-muted);
  text-align: center;
  padding: 5px;
}

.custom-avatar-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Floating theme-switcher button */
.custom-theme-fab {
  position: fixed;
  left: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--sgi-ink);
  color: var(--sgi-paper);
  border: 2px solid var(--sgi-line);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  z-index: 999;
  transition: transform 0.2s ease, background-color 0.3s, color 0.3s;
}

.custom-theme-fab:hover {
  transform: scale(1.1);
}

.custom-theme-fab svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Responsive auth buttons styling inside the header */
@media (max-width: 768px) {
  .custom-auth-container {
    padding: 6px 10px;
    gap: 8px;
  }
  .custom-btn-accedi, .custom-btn-registrati {
    font-size: 0.75rem;
    padding: 6px 12px;
  }
  .custom-btn-registrati {
    padding: 4px 10px;
  }
}

/* Dark Mode Variables and Overrides */
html.sgi-dark-theme, body.sgi-dark-theme {
  --sgi-paper: #101426;
  --sgi-ink: #f4efe6;
  --sgi-text: #e2e8f0;
  --sgi-line: #25293d;
  --sgi-muted: #a0aec0;
  --sgi-ink-soft: #f4efe6;
  --sgi-white: #1b2038;
}

html.sgi-dark-theme body {
  background-color: #101426;
}

html.sgi-dark-theme .sgi-header {
  background: rgba(16, 20, 38, 0.94);
  border-bottom: 1px solid var(--sgi-line);
}

html.sgi-dark-theme .sgi-nav-rail {
  border-top: 1px solid var(--sgi-line);
}

html.sgi-dark-theme .sgi-nav-list a {
  color: var(--sgi-ink);
}

html.sgi-dark-theme .sgi-nav-list a:hover {
  border-bottom-color: var(--sgi-mint);
}

html.sgi-dark-theme .sgi-btn--ghost {
  border-color: var(--sgi-ink);
  color: var(--sgi-ink);
}

html.sgi-dark-theme .sgi-btn--ghost:hover {
  background: var(--sgi-ink);
  color: #101426;
}

html.sgi-dark-theme .sgi-profile {
  background: #1b2038;
  border-color: var(--sgi-line);
}

html.sgi-dark-theme .sgi-profile__badge {
  background: var(--sgi-line);
  color: var(--sgi-ink);
}

html.sgi-dark-theme .sgi-pref {
  background: #1b2038;
}

html.sgi-dark-theme .sgi-mosaic__tile {
  background: #1b2038;
  border-color: var(--sgi-line);
}

html.sgi-dark-theme .sgi-newscard {
  background: #1b2038;
  border-color: var(--sgi-line);
}

html.sgi-dark-theme .custom-theme-fab {
  background-color: var(--sgi-paper);
  color: #101426;
}

html.sgi-dark-theme .sgi-field input,
html.sgi-dark-theme .sgi-field select,
html.sgi-dark-theme .sgi-field textarea {
  background-color: #1b2038;
  color: #e2e8f0;
  border-color: var(--sgi-line);
}

/* Custom Footer Styles to match design */
.custom-site-footer {
  background-color: #332d5a; /* Dark purple/blue background */
  color: #ffffff;
  padding: 60px 40px 40px;
  font-family: 'Unbounded', sans-serif, system-ui;
}

.custom-site-footer a {
  color: #ffffff;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.custom-site-footer a:hover {
  opacity: 0.8;
}

.custom-site-footer__grid {
  max-width: 1200px;
  margin: 0 auto 40px auto;
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: space-between;
}

.custom-site-footer__brand {
  flex: 1;
  min-width: 200px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.custom-site-footer__brand img {
  max-width: 180px;
  height: auto;
}

.custom-site-footer__nav {
  flex: 1;
  min-width: 200px;
}

.custom-site-footer__nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.custom-site-footer__nav li {
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.custom-site-footer__info {
  flex: 1;
  min-width: 250px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.custom-site-footer__info p {
  margin: 0 0 16px 0;
}

.custom-site-footer__text {
  max-width: 1200px;
  margin: 0 auto 40px auto;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #ffffff;
}

.custom-site-footer__text p {
  margin: 0 0 12px 0;
}

.custom-site-footer__copy {
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  margin: 0;
}
