// src/app/ui/shared/components/my-profile-map/my-profile-map.component.scss

.my-profile-map-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  background: white;
  border-radius: 16px;
  box-shadow:
    0 1px 3px 0 rgba(0, 0, 0, 0.1),
    0 1px 2px 0 rgba(0, 0, 0, 0.06);

  .header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;

    .title {
      font-size: 24px;
      font-weight: 700;
      color: #111827;
      margin: 0;
    }

    .subtitle {
      font-size: 14px;
      color: #6b7280;
      margin: 4px 0 0 0;
    }

    .visibility-toggle {
      display: flex;
      align-items: center;
      gap: 12px;

      .toggle-label {
        position: relative;
        display: inline-block;
        width: 48px;
        height: 24px;
        cursor: pointer;

        .toggle-input {
          opacity: 0;
          width: 0;
          height: 0;

          &:checked + .toggle-slider {
            background-color: #6366f1;

            &::before {
              transform: translateX(24px);
            }
          }
        }

        .toggle-slider {
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          background-color: #d1d5db;
          border-radius: 24px;
          transition: background-color 0.2s;

          &::before {
            content: '';
            position: absolute;
            height: 18px;
            width: 18px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            border-radius: 50%;
            transition: transform 0.2s;
          }
        }
      }

      .toggle-text {
        font-size: 14px;
        font-weight: 500;
        color: #374151;
      }
    }
  }

  .coordinates-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;

    .coordinates-icon {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      background: #eef2ff;
      border-radius: 10px;
      color: #6366f1;
    }

    .coordinates-label {
      font-size: 12px;
      font-weight: 500;
      color: #6b7280;
      margin: 0 0 4px 0;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .coordinates-value {
      font-size: 16px;
      font-weight: 600;
      color: #111827;
      margin: 0;
      font-family: monospace;
    }
  }

  .alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;

    svg {
      flex-shrink: 0;
    }

    &.alert-error {
      background: #fef2f2;
      color: #991b1b;
      border: 1px solid #fecaca;
    }

    &.alert-info {
      background: #eff6ff;
      color: #1e40af;
      border: 1px solid #bfdbfe;
    }
  }

  .actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
  }

  .map-wrapper {
    width: 100%;
  }

  .save-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
  }

  .info-message {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #f0f9ff;
    border-radius: 8px;
    border: 1px solid #bae6fd;

    svg {
      flex-shrink: 0;
      color: #0284c7;
    }

    p {
      margin: 0;
      font-size: 14px;
      color: #0c4a6e;
      line-height: 1.5;
    }
  }
}

// Boutons
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;

  svg {
    width: 20px;
    height: 20px;
  }

  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  &.btn-primary {
    background: #6366f1;
    color: white;

    &:hover:not(:disabled) {
      background: #4f46e5;
    }
  }

  &.btn-secondary {
    background: #f3f4f6;
    color: #374151;

    &:hover:not(:disabled) {
      background: #e5e7eb;
    }
  }

  &.btn-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;

    &:hover:not(:disabled) {
      background: #fee2e2;
    }
  }

  &.btn-outline {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;

    &:hover:not(:disabled) {
      background: #f9fafb;
    }
  }
}

.spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

// Responsive
@media (max-width: 768px) {
  .my-profile-map-container {
    padding: 16px;

    .header {
      flex-direction: column;

      .visibility-toggle {
        align-self: flex-start;
      }
    }

    .actions {
      flex-direction: column;

      .btn {
        width: 100%;
      }
    }
  }
}
